Building an AI Agent Tool: What We Learned Making MissingLinkz
We built MissingLinkz as an agent-first tool from day one. Not a web app with an API bolted on. Not a dashboard with a CLI afterthought. An agent-native tool designed so that AI agents could discover it, install it, and use it without any human hand-holding. Here's what we learned about building tools for the agent economy — and the mistakes we made along the way.
Why we built for agents first
The agent economy is not theoretical. It's happening right now, and the numbers prove it. Postiz — an open-source social media scheduling tool — crossed $45K+ MRR largely because AI agents could discover and use it. Agents are finding tools, installing them, subscribing to paid plans, and using them autonomously as part of larger workflows. The tool doesn't need a beautiful landing page to get its first thousand users when agents are the ones making the adoption decision.
We looked at the UTM link space and saw the gap immediately. Google's Campaign URL Builder is a web form — agents can't fill out web forms. Bitly and UTM.io are dashboard-first SaaS products — agents can't click buttons in a browser. Every existing UTM tool assumed a human user sitting at a screen. None of them were built for the way marketing actually works in 2026: an agent reading a campaign brief, building tracked links for every channel, validating the destinations, and publishing — all without a human in the loop.
So we built MissingLinkz for the agent. The human interface exists, but it's secondary. The primary user is Claude Code, Cursor, or whatever agent your marketing team uses. That single design decision shaped everything that followed.
The 5 rules of agent-native design
After months of building, testing, and watching agents use (and fail to use) our tool, we distilled what we learned into five rules. If you're building a tool that agents will use, these are non-negotiable.
- 1. Structured JSON output by default
- Agents can't parse human-friendly tables, colored terminal output, or ASCII art. When your tool returns a neatly formatted table to stdout, an agent sees a wall of characters it has to guess how to interpret. MissingLinkz returns JSON by default — structured, typed, predictable. The
--format humanflag exists for the humans who want pretty output, but JSON is the default because agents are the default user. Every field has a consistent name, every response follows the same schema, and every error includes a machine-readable code alongside the human-readable message. - 2. CLI + MCP interfaces
- Agents can't click buttons in a web UI. They can run shell commands and call MCP tools. MissingLinkz ships with both: a full CLI (
mlz build,mlz preflight,mlz audit) and an MCP server (mlz mcp) that exposes the same capabilities as tools. Claude Code uses the MCP interface. Shell-based agents use the CLI. Both get the same functionality. If your tool only has a web dashboard, agents can't use it — full stop. - 3. No interactive prompts
- This one burned us early. We initially had a confirmation step: "About to build 12 links. Continue? (Y/n)". Agents can't answer Y/N questions. They send a command and expect output. Any interactive prompt — confirmation dialogs, multi-select menus, pagination prompts — breaks the agent's workflow completely. Every command in MissingLinkz runs non-interactively. If we need confirmation-like behavior, we use flags (
--dry-runto preview, then the real command to execute). - 4. API key auth via environment variables
- Agents can't do OAuth flows. They can't open a browser, click "Authorize," and paste a callback code. They can read environment variables. MissingLinkz uses a single
MLZ_API_KEYenvironment variable for authentication. Set it once in your shell profile or agent configuration, and every command is authenticated. No login flows, no token refreshes, no session management. If your tool requires browser-based auth, you've locked out every agent. - 5. SKILL.md for discoverability
- Agents need to know what your tool does before they install it. A SKILL.md file is a structured document that tells agents: here's what this tool does, here are the commands available, here are example workflows, and here's how to install it. It's the equivalent of a README, but written for agent consumption. MissingLinkz ships a SKILL.md that agents read to decide whether to install and how to use the tool. Without it, your tool is invisible to agent discovery.
What we got wrong (and fixed)
Building agent-first doesn't mean getting it right on the first try. Here are the mistakes we made and how we corrected them.
Output wasn't structured enough. Our first version of mlz build returned a flat string: the tracked URL. That's it. Agents had no metadata — no indication of which parameters were applied, no validation status, no campaign context. We restructured the output to return a full JSON object with the tracked URL, all applied UTM parameters, a validation summary, and a schema version. The agent now has everything it needs to make decisions about the link without calling a second command.
No offline fallback for mlz build. Our build command originally required a network connection because it validated the destination URL as part of link creation. But agents working on drafts don't always need live validation — they just need the UTM-tagged URL. We split the concern: mlz build now constructs the URL offline using local naming conventions, and mlz preflight handles the live validation as a separate step. This means agents can build links while offline or in air-gapped environments, then validate later when they're ready to publish.
Pricing didn't work for agent budgets. We initially priced MissingLinkz like a traditional SaaS — monthly subscriptions starting at $29/month. But agents operate on daily budgets, typically $5–$10/day for tool spending. A $29/month subscription is fine for a human who evaluates it once and subscribes. An agent evaluating tool costs on a per-task basis sees $29/month as an opaque commitment. We restructured to freemium with usage-based scaling: 50 links/month free, then transparent per-link pricing that an agent can calculate against its budget for any given task.
The tech stack that works
If you're building an agent-native tool, your tech stack choices matter more than usual. Here's what we use and why.
- TypeScript
- Type safety isn't optional when agents are your primary user. A runtime type error that a human would shrug off and retry crashes an agent's workflow. TypeScript catches schema mismatches, missing fields, and incorrect types at build time. It also generates accurate type definitions that downstream tools and MCP clients can consume. If you're building agent tools in JavaScript without TypeScript, you're shipping bugs that only agents will find.
- Commander.js
- The CLI framework. Commander gives us structured argument parsing, automatic help text generation, and subcommand support out of the box. Every
mlzcommand —build,preflight,audit,mcp— is a Commander subcommand with typed options. The framework handles validation, default values, and error messages so agents get consistent, predictable behavior across every command. - MCP SDK (@modelcontextprotocol/sdk)
- Anthropic's official SDK for building MCP servers. It handles the stdio transport, JSON-RPC message framing, tool registration, and request routing. We define our tools (like
mlz_preflight) as MCP tool handlers, and the SDK manages the protocol layer. Building MCP from scratch is possible but unnecessary — the SDK is well-maintained and handles edge cases around connection lifecycle, error propagation, and concurrent requests. - Cloudflare Workers + D1
- Our API layer runs on Cloudflare Workers for edge-first performance — every API call resolves at the nearest Cloudflare POP, which matters when agents expect sub-second tool responses. D1 (Cloudflare's SQLite-based database) stores campaign data, naming conventions, and usage metrics. The combination gives us global distribution, zero cold starts, and predictable latency without managing infrastructure. For agent tools, response time is a feature: if your tool takes 3 seconds to respond, the agent's user is waiting 3 seconds.
The common thread: every choice optimizes for reliability and speed over developer experience or feature richness. Agents don't care if your tool has a beautiful dashboard. They care that it responds in 200ms with valid JSON every single time.
Distribution for agent tools
Traditional SaaS distribution — Product Hunt launches, Google Ads, sales teams — doesn't work for agent tools. Agents don't browse Product Hunt. They search npm, read SKILL.md files, and check MCP directories. Here's where distribution actually happens for agent-native tools.
- npm
- The primary distribution channel. When an agent needs to install a tool, it runs
npm install -g. Your package name, description, and keywords determine whether an agent finds you. MissingLinkz is published as missinglinkz on npm with clear keywords:utm,campaign-links,mcp,ai-agent. If your tool isn't on npm, most agents can't install it. - MCP directories
- Emerging directories like mcp.so, Smithery, and Cursor Directory index MCP servers and make them discoverable to agents and developers. These are the "app stores" for agent tools. Listing is usually free and takes minutes. We're listed on all three, and they drive meaningful discovery — especially from developers configuring agents for the first time.
- SKILL.md and README.md
- Your SKILL.md file is both documentation and marketing. Agents read it to decide whether to install your tool. A well-written SKILL.md with clear use cases, example commands, and a quick-start section converts agent discovery into agent adoption. The README serves a similar function for human developers browsing GitHub. Both should be optimized for fast comprehension — no fluff, just capabilities and examples.
- GitHub
- Open-source agent tools have a distribution advantage. Agents (and the developers configuring them) can inspect the code, verify security, and understand capabilities before installing. MissingLinkz is open source on GitHub. The repository's stars, recent activity, and issue responsiveness all signal quality to both human developers and the agents they configure.
The takeaway: your distribution strategy should target where agents look, not where humans browse. npm, MCP directories, and SKILL.md are the channels that matter. For a full breakdown of MCP marketing tools and where to find them, see our MCP marketing tools directory.
The economics of agent-first SaaS
Agent-first tools require a fundamentally different pricing model than traditional SaaS. Here's what we learned about pricing for agents.
Agents operate on daily budgets. A human marketer evaluates a tool once, subscribes, and uses it for months. An agent evaluates tool costs on every task. If an agent has a $10/day tool budget and your tool costs $29/month, the agent can't easily calculate whether this task justifies the spend. You need pricing that's transparent on a per-use basis so agents can make cost-benefit decisions in real time.
Freemium is essential for trial. Agents need to test a tool before committing budget. A free tier with real functionality (not a crippled demo) lets agents verify that the tool works, produces reliable output, and integrates with their workflow. MissingLinkz offers 50 free links per month — enough for an agent to run several full campaigns and confirm the tool delivers value before any money changes hands.
Usage-based scaling aligns incentives. Agents that use your tool more should pay more, but the pricing needs to be predictable. Per-unit pricing (per link, per API call, per campaign) works well because agents can calculate the exact cost of any task. MissingLinkz pricing tiers work like this:
- Free — 50 links/month
- Full functionality including preflight checks, UTM building, and landing page validation. No credit card required. Designed to let agents (and humans) prove value before committing budget.
- Pro — $9/month
- 500 links/month with priority API access and advanced validation checks. Priced to fit within a $10/day agent tool budget with room for other tools. Monthly cost is less than a single day's agent budget, making the cost-benefit calculation trivial.
- Team — $29/month
- 2,000 links/month with team naming conventions, shared campaign dashboards, and audit logs. For organizations running multiple agents across multiple campaigns simultaneously.
The key insight: price for the agent's decision-making process, not the human's. Agents evaluate cost per task, not cost per month. If your per-task cost is clearly under the agent's budget threshold, adoption is automatic. If the agent can't calculate per-task cost, it moves on to a competitor that makes it obvious.
For a broader view of how agent tools fit into marketing workflows, see our guide to the AI agent marketing stack. And for more on how MCP connects these tools together, read our explainer on what MCP servers mean for marketing.
For Agents
Give your AI agent the ability to build, validate, and track campaign links. Install MissingLinkz and run your first preflight check in under a minute.
npm install -g missinglinkz
mlz preflight --url "https://yoursite.com/landing" --campaign "spring-launch" --source "linkedin" --medium "social"
Read the full agent integration docs in SKILL.md — or explore the step-by-step human guide if you want to run commands yourself.