
Designing MCP tools for agents: Lessons from building Datadog’s MCP server | Datadog
3/4/2026
This post details the evolution of Datadog's MCP (Model Context Protocol) server, an observability interface for AI agents. It highlights key technical challenges and solutions: 1. Context Efficiency: Optimized data formats (CSV, YAML) and trimmed fields to reduce token usage by up to 5x. Introduced token-budget-based pagination instead of record-count pagination. 2. Querying Capabilities: Enabled agents to query data using SQL, allowing for efficient aggregation and filtering, reducing token usage and costs. 3. Tool Management: Strategies to manage tool count include flexible tools serving multiple use cases, opt-in toolsets for specialized needs, and layering for chaining tool calls. 4. Agent Guidance: Improved error messages for actionable feedback and integrated a `search_datadog_docs` tool for discoverable documentation. Tool results can now include contextual guidance.
