Skip to content

In development. Expect rough edges and changes. The source code is not public yet.

Datadog Engineering 8 min read Case study mediumAdept

Designing MCP tools for agents: Lessons from building Datadog’s MCP server

Thin API wrappers make poor MCP tools: agents flood their context windows, blow token budgets on oversized records, and infer trends from raw samples. Datadog's MCP server fixes this with token-efficient formats (CSV/TSV for flat data, YAML for nested), trimmed default fields, and pagination by token budget instead of record count, fitting about 5x more records per token. It also exposes a SQL query interface over logs, which made eval runs about 40% cheaper. Other lessons: keep tool count low with flexible tools, opt-in toolsets or layering; return specific, actionable error messages; offer a RAG docs-search tool; and include guidance hints in tool results.

Assumes: Model Context Protocol basicsLLM context windows and tokenstool calling in LLM agents

Related posts

  • 5 Best Practices for Building, Testing, and Packaging MCP Servers

    Docker mediumAdept

    MCP servers work best when designed around the agent as the real caller: keep a small "tool budget" by grouping endpoints into use-case tools and prompts instead of one tool per API endpoint, and return error messages that tell the agent what to fix (e.g., an invalid API_TOKEN configuration) rather than human-facing denials. Tool names and descriptions double as documentation for agents, while user docs explain the value. Test the connect, list-tools and tool-call lifecycle with the MCP Inspector or `docker mcp` commands, and open connections per tool call rather than at startup so tools can be listed even when the server is misconfigured. Package servers as Docker images using stdio transport for submission to the Docker MCP Catalog.

  • Auto-generating MCP Servers from OpenAPI Schemas: Yay or Nay?

    Neon easyNovice

    Auto-generating an MCP server as a 1:1 mapping of an OpenAPI spec works poorly. LLMs struggle to pick among hundreds of similar tools (GitHub's API has over 600 operations), handle complex JSON payloads and optional parameters badly, and resource-centric REST endpoints don't match the task-level workflows agents perform. The recommended hybrid is to use codegen as a starting point, aggressively prune the generated tools, and rewrite descriptions to explain when and why to use each one. Then add higher-level tools that wrap multi-step workflows, while staying cautious about statefulness. Neon built its open-source MCP server this way on top of its TypeScript SDK, including a workflow for running and testing database migrations.

  • Building AI-Powered Observability with Heroku Managed Inference and Agents

    Heroku Engineering mediumAdept

    Observability platforms like Splunk, Honeycomb and Sentry can be exposed to AI coding assistants as MCP tools, so engineers query production telemetry in natural language from Cursor or Claude instead of switching to dashboards and writing SPL. The Go servers define typed MCP tools and handlers that translate tool calls into platform API calls. They are deployed as STDIO processes behind Heroku Managed Inference and Agents, whose MCP gateway handles SSE transport and auth, and clients connect via mcp-remote with an inference token. Claimed benefits include faster incident triage, security pattern spotting such as auth-failure spikes, and quicker onboarding, though the evidence is anecdotal and promotional.

  • You are Doing MCP Wrong: 3 Big Misconceptions

    Docker mediumAdept

    MCP is a model-facing protocol for LLM tool use and context exchange, not a replacement for REST or gRPC. Tools execute while agents plan, re-plan and evaluate, and MCP also covers resources, prompts and elicitations alongside tools. The recommended architecture treats MCP as the seam between a non-deterministic planning layer and a deterministic execution layer. Concrete patterns include wrapping existing APIs with tools that declare pre/postconditions, keeping the agent control loop outside tools with explicit stop criteria, versioning prompts in a registry, using elicitations for low-confidence branches, and tracing plan → tool → result for replay and audit.

  • Dynamic MCPs with Docker: Stop Hardcoding Your Agents’ World

    Docker mediumAdept

    Docker MCP Gateway now exposes primordial tools (mcp-find, mcp-add) that let agents search a curated catalog of 270+ MCP servers, add them to the live session, and trigger OAuth or elicitation flows, instead of hand-editing JSON config and restarting. The gateway can also hide added servers' tool definitions from tools/list so they stay discoverable without bloating the context window. A code-mode tool lets agents write JavaScript that composes tools from several MCP servers inside a Docker sandbox, keeping intermediate results out of the model and cutting per-turn token usage. The features ship in Docker Desktop 4.50 and are on by default, and cagent can expose such agents to ACP-enabled editors like Zed and Neovim.

The quest for software engineering knowledge.

Look:
Layout: