As artificial intelligence (AI) applications become more sophisticated and interact with increasingly complex external systems, better tool metadata becomes crucial. Although the Model Context Protocol (MCP) was introduced only a couple of months ago, it is very much alive and evolving quickly. One of its latest advancements is the introduction of MCP Tool annotations.
Annotations provide a layer of metadata that enhances the interaction between AI models and external tools, making it easier for AI models, clients, and users to understand how these tools behave and what they can do.
In this post, Iâll walk through what Tool annotations are, why they matter, and give a few examples based on the Kubernetes MCP Server.
What are MCP Tool Annotations?MCP Tool annotations are specialized metadata that you can attach to your MCP tools to communicate their behavior characteristics to the MCP client. Think of them as labels that describe what your tool does and how it behaves, similar to how you might label physical tools in a workshop.
These annotations serve as advisory hints that help client applications make informed decisions about tool usage, display appropriate user interfaces, and implement safety controls.
Note
Annotations are hints provided by the MCP server and are informational only. They do not enforce any behavior or restrictions on the tool itself. Don't blindly trust them, as they are not guaranteed to be accurate or complete.
Why are MCP Tool Annotations Important?MCP Tool annotations allow servers to express the behavior of their tools in a standardized way. By using annotations, tools become self-descriptive, which brings several benefits:
The MCP specification defines several standard annotations that cover the most common tool behavior patterns:
Annotation Type Description titlestring
A human-readable title for the tool, useful for displaying in user interfaces. This is particularly useful when your tool's function name isn't descriptive enough for end users.
readOnlyHintboolean
Indicates whether the tool only reads data without making any modifications. This is crucial for tools that query information versus those that change system state.
destructiveHintboolean
For non-read-only tools, this signals whether the changes made are destructive or reversible. This helps client applications implement appropriate warnings and confirmations.
idempotentHintboolean
Specifies whether repeated identical calls have the same effect as a single call. This is important for understanding whether a tool can be safely retried.
openWorldHintboolean
Indicates whether the tool interacts with external systems beyond the local environment. This helps in understanding the tool's scope and potential dependencies.
A Real-World Example: Kubernetes MCP ServerLet's look at how these annotations can be applied in a real-world scenario using the Kubernetes MCP Server as an example.
The Kubernetes MCP Server provides a set of tools to interact with Kubernetes clusters, and it uses MCP Tool annotations to enhance the user experience.
For instance, consider the following tool definition for the helm_list
function:
{mcp.NewTool("helm_list",
mcp.WithDescription("List all the Helm releases in the current or provided namespace (or in all namespaces if specified)"),
mcp.WithString("namespace", mcp.Description("Namespace to list Helm releases from (Optional, all namespaces if not provided)")),
mcp.WithBoolean("all_namespaces", mcp.Description("If true, lists all Helm releases in all namespaces ignoring the namespace argument (Optional)")),
// Tool annotations
mcp.WithTitleAnnotation("Helm: List"),
mcp.WithReadOnlyHintAnnotation(true),
mcp.WithDestructiveHintAnnotation(false),
mcp.WithOpenWorldHintAnnotation(true),
), s.helmList},
In this example, the tool helm_list
is defined with several annotations:
true
indicates that this tool only reads data from the Kubernetes cluster without making any changes.false
since this function lists Helm releases without modifying anything. By indicating that this tool does not perform any damaging actions, client applications can avoid unnecessary warnings.true
indicates that this tool interacts with an external system (the Kubernetes cluster), which is important for understanding its scope and potential dependencies.For more examples, check the Kubernetes MCP Server mcp package which contains many other tools with various annotations.
Best Practices for MCP Tool AnnotationsWhen implementing tool annotations, consider the following guidelines:
MCP Tool annotations provide a powerful way to enhance your AI tools with essential metadata that improves user experience and system safety. By thoughtfully applying these annotations to your tools, you create more robust and user-friendly AI integrations.
In my Kubernetes MCP Server, annotations help users understand the difference between safe query operations and potentially destructive cluster modifications, making the tool more trustworthy and easier to use in production environments.
As you build your own MCP servers, remember that annotations are about communication: they help bridge the gap between what your tool does technically and what users need to know to use it effectively.
You Might Also LikeRetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4