Inferensys

Glossary

Tool Definition

A Tool Definition is the formal specification of an executable function within an AI system, comprising its name, description, and a JSON Schema object that defines the structure and validation rules for its input parameters.
Developer building agentic RAG system, retrieval pipeline diagram on laptop, technical workspace with notes.
MCP GLOSSARY

What is a Tool Definition?

The formal specification for an executable function within the Model Context Protocol.

A Tool Definition is the formal specification of an executable function within the Model Context Protocol (MCP), comprising a unique name, a human-readable description, and a JSON Schema object that defines the structure, data types, and validation rules for its required input parameters. This definition acts as a contract between an MCP server, which implements the tool's logic, and an MCP client, such as an AI assistant, enabling the client to understand how to correctly invoke the external capability.

The input schema within the definition provides a machine-readable blueprint that allows clients to generate properly formatted arguments, enabling structured output guarantees and reducing errors. By standardizing how tools are described, MCP facilitates tool discovery, secure tool invocation, and reliable integration, allowing AI agents to dynamically extend their capabilities by interacting with databases, APIs, and other external systems.

MODEL CONTEXT PROTOCOL

Core Components of a Tool Definition

A Tool Definition is the formal specification that enables an AI agent to understand and safely invoke an external function. It acts as a contract between the MCP server and client.

01

Name

The unique identifier for the tool within the server's namespace. It must be a clear, alphanumeric string (often using snake_case) that the AI model uses to reference the tool in its reasoning.

  • Example: get_current_weather or create_calendar_event
  • Purpose: Provides a stable API for the model to call. Changing a tool's name is a breaking change for any client or prompt that references it.
02

Description

A natural language explanation of the tool's purpose, behavior, and any critical constraints. This text is injected into the AI model's context to guide its decision on when and how to use the tool.

  • Key Elements: Should state the tool's goal, the meaning of its inputs/outputs, and side effects (e.g., 'This tool charges the user's credit card').
  • Best Practice: Write for the AI, not just humans. Be explicit about preconditions and outcomes to prevent misuse.
03

Input Schema

A JSON Schema object that rigorously defines the structure, data types, validation rules, and optional descriptions for all parameters the tool accepts.

  • Core Function: Enforces type safety and validates arguments before the handler executes.
  • Common Properties: type (e.g., object), properties, required array, and nested schemas for complex parameters.
  • Example Schema: Defines that a city parameter is a required string and a unit parameter is an optional string that must be either 'celsius' or 'fahrenheit'.
04

Tool Handler

The server-side implementation function (business logic) that executes when the tool is invoked. It receives the validated input arguments, interacts with the external system (API, database, script), and returns a result.

  • Separation of Concerns: The definition is the interface; the handler is the implementation.
  • Execution Flow: MCP Client → JSON-RPC Request → Schema Validation → Handler Execution → JSON-RPC Response.
  • Responsibility: Contains all authentication, networking, error handling, and data transformation logic specific to the integrated service.
05

Structured Output

While not always explicitly defined in a separate schema, the tool's return value is a structured JSON object. Consistent output structure is crucial for the AI client to parse and reason about the result.

  • Implicit Contract: The handler's return type forms an output schema.
  • Best Practice: Document the output shape in the tool's description. For complex returns, some frameworks allow defining an output JSON Schema.
  • Example: A weather tool should always return an object with { "temperature": number, "conditions": string }.
06

Related Concepts

A Tool Definition does not exist in isolation. It integrates with several key MCP and API execution concepts:

  • Schema Validation: The runtime process that checks tool inputs against the Input Schema.
  • Tool Invocation: The JSON-RPC call from client to server that triggers the handler.
  • API Schema Integration: The practice of automatically generating Tool Definitions from existing OpenAPI/Swagger specifications.
  • Orchestration Layer: The system that manages the sequencing, error handling, and caching of multiple tool calls within an agent's workflow.
MECHANISM

How Tool Definitions Work in AI Systems

A Tool Definition is the formal specification that enables an AI agent to understand and correctly call an external function or API.

A Tool Definition is a structured schema that formally describes an executable function to an AI agent, such as a large language model. It specifies the tool's name, a natural language description of its purpose, and a JSON Schema object that defines the required input parameters, their data types, and validation rules. This definition acts as a contract, allowing the AI to construct a valid call with the correct arguments. In protocols like the Model Context Protocol (MCP), these definitions are dynamically provided by MCP Servers to MCP Clients, enabling secure, structured interaction with external systems.

The JSON Schema within the Tool Definition is critical for schema validation, ensuring the AI-generated inputs are type-safe and conform to the backend API's expectations before execution. This prevents malformed requests and runtime errors. The definition is used during tool invocation, where the client sends a request containing the populated parameters to the server's tool handler. This mechanism, central to function calling, allows AI systems to move beyond text generation to perform concrete actions like querying databases, sending emails, or updating records, based on a standardized, machine-readable interface.

TOOL DEFINITION

Frequently Asked Questions

A Tool Definition is the formal specification of an executable function within the Model Context Protocol (MCP). It provides the blueprint that enables AI agents to understand and securely invoke external capabilities.

A Tool Definition is the formal specification of an executable function within the Model Context Protocol (MCP), comprising a unique name, a human-readable description, and a JSON Schema object that defines the structure, data types, and validation rules for its input parameters. It acts as a contract between an MCP server and an AI client, enabling the client to understand what the tool does, how to call it, and what arguments it requires. This definition is advertised by the server during capability negotiation and is used by the client to construct a valid tool invocation request. The schema ensures type safety and prevents malformed calls by validating inputs before they reach the server's tool handler.

Prasad Kumkar

About the author

Prasad Kumkar

CEO & MD, Inference Systems

Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.

His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.