A logo showing the text blog.marcnuri.com
Español
Home»Artificial Intelligence»MCP Tool Annotations: Adding Metadata and Context to Your AI Tools

Recent Posts

  • MCP Tool Annotations: Adding Metadata and Context to Your AI Tools
  • Fabric8 Kubernetes Client 7.2 is now available!
  • Connecting to an MCP Server from JavaScript using AI SDK
  • Connecting to an MCP Server from JavaScript using LangChain.js
  • The Future of Developer Tools: Adapting to Machine-Based Developers

Categories

  • Artificial Intelligence
  • Front-end
  • Go
  • Industry and business
  • Java
  • JavaScript
  • Legacy
  • Operations
  • Personal
  • Pet projects
  • Tools

Archives

  • May 2025
  • April 2025
  • March 2025
  • February 2025
  • January 2025
  • December 2024
  • November 2024
  • August 2024
  • June 2024
  • May 2024
  • April 2024
  • March 2024
  • February 2024
  • January 2024
  • December 2023
  • November 2023
  • October 2023
  • September 2023
  • August 2023
  • July 2023
  • June 2023
  • May 2023
  • April 2023
  • March 2023
  • February 2023
  • January 2023
  • December 2022
  • November 2022
  • October 2022
  • September 2022
  • August 2022
  • July 2022
  • June 2022
  • May 2022
  • March 2022
  • February 2022
  • January 2022
  • December 2021
  • November 2021
  • October 2021
  • September 2021
  • August 2021
  • July 2021
  • January 2021
  • December 2020
  • November 2020
  • October 2020
  • September 2020
  • August 2020
  • July 2020
  • June 2020
  • May 2020
  • February 2020
  • January 2020
  • December 2019
  • October 2019
  • September 2019
  • July 2019
  • March 2019
  • November 2018
  • July 2018
  • June 2018
  • May 2018
  • April 2018
  • March 2018
  • February 2018
  • December 2017
  • July 2017
  • January 2017
  • December 2015
  • November 2015
  • December 2014
  • March 2014
  • February 2011
  • November 2008
  • June 2008
  • May 2008
  • April 2008
  • January 2008
  • November 2007
  • September 2007
  • August 2007
  • July 2007
  • June 2007
  • May 2007
  • April 2007
  • March 2007

MCP Tool Annotations: Adding Metadata and Context to Your AI Tools

2025-05-27 in Artificial Intelligence tagged LLM / AI Agent / Model Context Protocol (MCP) / Kubernetes by Marc Nuri | Last updated: 2025-05-27
Versión en Español

Introduction

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:

  • Enhanced User Experience: Annotations enable client applications to present tools with user-friendly titles and descriptions, making it easier for users to understand what each tool does.
  • Improved Safety and Control: Annotations help implement appropriate safety measures and user confirmations by indicating whether tools are destructive or read-only.
  • Better Tool Discovery: Annotations allow clients to filter and discover tools based on their characteristics, making it easier to find the right tool for a specific task.
  • Consistency Across Tools: Annotations provide a consistent way to describe tool behavior, making it easier for developers to understand and use different tools across various MCP servers.

Available MCP Tool Annotations

The MCP specification defines several standard annotations that cover the most common tool behavior patterns:

AnnotationTypeDescription
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 Server

Let'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/helm.go
{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:

  • Title: "Helm: List" provides a clear and concise name for the tool to be presented to end users.
  • Read-Only Hint: true indicates that this tool only reads data from the Kubernetes cluster without making any changes.
  • Destructive Hint: Marked as 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.
  • Open World Hint: 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 Annotations

When implementing tool annotations, consider the following guidelines:

  • Be Accurate: Ensure that the annotations truthfully reflect the tool's behavior. Misleading annotations can lead to poor user experiences or safety issues.
  • Think about Users: Use clear and descriptive titles and descriptions that help users (as opposed to developers) understand the tool's purpose. Avoid technical jargon that may confuse end users.
  • Consider Safety Implications: Be conservative with destructive and read-only hints. When in doubt, err on the side of caution.
  • Keep Annotations Up to Date: As tools evolve, ensure that their annotations are updated to reflect any changes in behavior or functionality.
  • Use Annotations Consistently: Apply annotations uniformly across all tools in your MCP server to maintain a consistent user experience.

Conclusion

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 Like

  • Introduction to the Model Context Protocol (MCP): The Future of AI Integration
  • Giving Superpowers to Small Language Models with Model Context Protocol (MCP)
  • Introducing Goose, the on-machine AI agent
Twitter iconFacebook iconLinkedIn iconPinterest iconEmail icon

Post navigation
Fabric8 Kubernetes Client 7.2 is now available!
© 2007 - 2025 Marc Nuri