Skip to main content
Glama
awslabs

Threat Modeling MCP Server

Official
by awslabs

validate_threat_model_against_code

Analyze your codebase to identify which threats from your threat model are already mitigated, and generate a markdown validation report.

Instructions

Validate the threat model against the actual codebase.

This tool analyzes the codebase to determine which threats are already mitigated by existing security controls, and generates a comprehensive report.

Args: ctx: MCP context for logging and error handling code_directory: Directory containing code to analyze file_patterns: Optional list of file patterns to include (e.g., [".py", ".js"])

Returns: A markdown-formatted validation report

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
file_patternsNo
code_directoryYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Since no annotations are provided, the description carries the full burden. It clearly states the tool analyzes the codebase and generates a report, which conveys its main behavior. However, it does not disclose whether the tool modifies anything, requires specific permissions, or could be time-consuming. This is adequate but lacks depth on side effects or limitations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is well-structured with a clear intro, explanation, Args section, and Returns section. It is appropriately sized with no redundant information. The markdown formatting and front-loaded main purpose make it easy to scan and understand.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The description covers the core aspects: purpose, parameters, and return value ('A markdown-formatted validation report'). Given that an output schema exists, it need not detail the report structure. However, it lacks context about prerequisites or how this fits into the broader workflow, which is a minor gap given the tool's complexity.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must compensate. It does so by explaining code_directory as 'Directory containing code to analyze' and file_patterns as 'Optional list of file patterns to include (e.g., ["*.py", "*.js"])'. This adds meaningful context beyond the schema's minimal titles, including an example for file patterns.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's function: 'Validate the threat model against the actual codebase.' It also explains it analyzes the codebase to determine which threats are mitigated by existing security controls and generates a report. This is specific and actionable, but it does not explicitly differentiate from sibling tools like validate_security_controls or execute_code_validation_step, so it falls short of a 5.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no explicit guidance on when to use this tool versus alternatives. It does not mention prerequisites, such as having a threat model defined, or when in the workflow this should be run. The only implicit context is the tool's name and description, but no direct usage recommendations or exclusions are given.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/awslabs/threat-modeling-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server