fingerprint_tool_metadata
Analyze an MCP tool definition for instruction-injection and malicious patterns.
Performs semantic fingerprinting of the tool's description, parameter schemas,
and error templates — detecting credential exfiltration vectors, C2 callbacks,
base64 payloads, authority spoofing, and injection phrase patterns.
Also checks the tool hash against the SKILL IOC feed and the description
against the PROMPT IOC feed for known-malicious matches.
If track=True (default), the tool definition is compared against a stored
baseline and semantic drift is detected on subsequent calls for the same tool.
Args:
tool_def: MCP tool definition dict. Expected keys: name, description,
inputSchema (optional), annotations (optional).
registry: Registry this tool came from ("mcp.so", "clawhub", "smithery",
"npm", "pypi", "github", or "unknown").
track: If True, maintain baseline and detect drift across calls.
Returns:
tool_name: Tool name
tool_hash: SHA256 of canonical tool definition
risk: "clean" | "low" | "suspicious" | "malicious"
risk_score: 0.0–1.0
should_block: True if risk == malicious
should_warn: True if risk >= suspicious
signals: List of detected signals with field, pattern, excerpt
prompt_ioc_matched: True if description matched PROMPT IOC feed
skill_ioc_matched: True if tool hash matched SKILL IOC feed
latency_ms: Analysis latency
drift: Drift result (if track=True and tool was seen before)
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| track | No | ||
| registry | No | unknown | |
| tool_def | Yes |