Discovery-First Design for Agents

Exposing data through a Multi-Modal Communication Protocol (MCP) is only the first step. The true challenge lies in designing tools that AI agents can use effectively. An agent's ability to leverage a tool hinges on its capacity to understand and interact with it. This requires shaping tools for how an AI model calls them, not just for human consumption. Bonnard's approach, exemplified by @bonnard/mcp-charts and the visualize tool, centers on this agent-first philosophy.

The core principle is to eliminate guesswork. An agent that must guess a data schema is prone to generating incorrect queries. To prevent this, Bonnard introduces a discovery tool as the agent's initial point of interaction. Before ever calling the primary visualize tool, the agent first invokes visualize_read_me. This function loads essential information: the available chart options, the tool's schema, and crucially, worked examples. Following this, an explore_schema tool is used to map out the available tables and columns. This read-then-act sequence ensures the agent operates with a clear understanding of the data landscape.

Diagram illustrating the agent's discovery process before tool execution

Purpose-Built Tools Over Generalization

A common pitfall in designing agent tools is the temptation to create a single tool for every conceivable metric or a monolithic tool attempting to serve all purposes. This broad approach often leads to inefficiency and complexity. Instead, Bonnard advocates for a small, curated set of purpose-built tools. Each tool is meticulously designed to perform a specific function exceptionally well, minimizing ambiguity for the agent.

For instance, the visualize tool is not a catch-all for every charting need. It's designed to translate structured requests into visual representations, but its effectiveness relies on the preceding discovery phase. The agent, having explored the schema and understood the available charting types through visualize_read_me, can then make precise calls to visualize. This targeted design reduces the cognitive load on the agent and increases the reliability of its outputs. The focus is on precision and clarity, ensuring that when an agent calls a tool, it knows precisely what to expect and how to interpret the results.

Structuring for Agent Comprehension

The underlying structure of the MCP and the tools it exposes plays a critical role. Bonnard emphasizes making the tool schema explicit and human-readable, but more importantly, machine-readable. This means defining clear input parameters, output formats, and providing descriptive documentation within the schema itself. Worked examples are not just helpful for humans; they serve as vital training data for the agent, demonstrating how to correctly invoke the tool in various scenarios.

Consider the process of generating an SQL query. An agent needs to understand not just the syntax but the semantics of the database schema. By providing an explore_schema tool, Bonnard equips the agent with the ability to dynamically learn the structure. This is akin to giving a junior developer access to the database documentation and a few example queries before asking them to write a complex report. The agent doesn't need to be pre-programmed with every possible table name or column type; it can discover them. This adaptability is key to building robust agentic systems that can interact with diverse and evolving data sources.

Beyond Basic API Exposure

Building agent-friendly MCPs goes beyond simply exposing data endpoints. It involves a deep understanding of how AI agents process information and make decisions. The agent needs context, clear instructions, and predictable interfaces. Bonnard's approach integrates these elements by making discovery a first-class citizen and by crafting tools that are narrowly scoped and well-documented.

This methodology contrasts with traditional API design, which often prioritizes human developer experience. While human readability is important, the primary consumer of an MCP tool is an AI agent. Therefore, the design must account for the agent's limitations and capabilities. This means providing explicit schemas, examples, and dedicated exploration tools. The result is a system where agents can reliably access and utilize data, moving from speculative querying to informed action. The success of tools like @bonnard/mcp-charts demonstrates the power of this agent-centric design philosophy.