feat: Add tool annotations for improved LLM tool understanding#125
Open
bryankthompson wants to merge 1 commit into0x4m4:masterfrom
Open
feat: Add tool annotations for improved LLM tool understanding#125bryankthompson wants to merge 1 commit into0x4m4:masterfrom
bryankthompson wants to merge 1 commit into0x4m4:masterfrom
Conversation
Add readOnlyHint, destructiveHint, openWorldHint, and title annotations to all 151 MCP tools. All security tools marked as destructive and open-world since they interact with external targets. Changes: - Added ToolAnnotations import from mcp.types - Upgraded fastmcp requirement to >=2.0.0 for annotation support - Added annotations to all 151 tools with: - title: Human-readable tool names - readOnlyHint=False: Tools actively interact with targets - destructiveHint=True: Security scanning can impact targets - openWorldHint=True: All tools interact with external systems This improves tool safety metadata for MCP clients. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds MCP tool annotations (
readOnlyHint,destructiveHint,openWorldHint,title) to all 151 MCP tools to help LLMs better understand tool behavior and make safer decisions about tool execution.Changes
from mcp.types import ToolAnnotationsimportfastmcprequirement to>=2.0.0for annotation supporttitle: Human-readable tool names (e.g., "Nmap Scan", "AI Vulnerability Assessment")readOnlyHint=False: Tools actively interact with targetsdestructiveHint=True: Security scanning/testing can impact targetsopenWorldHint=True: All tools interact with external systems/networksWhy This Matters
Tool Classification Rationale
All 151 tools are cybersecurity/pentesting tools that:
Therefore, all tools are marked with:
destructiveHint=True- scanning can impact targetsopenWorldHint=True- tools access external networks/systemsTesting
python3 -m py_compile hexstrike_mcp.pyExample Before/After
Before:
After:
🤖 Generated with Claude Code