Skip to main content
Glama
kvnpetit

SRC (Structured Repo Context)

by kvnpetit

Run local static analysis

run_static_analysis
Read-onlyIdempotent

Run local static analyzers (ast-grep, Semgrep, or CodeQL) on project paths with fixed safe arguments, timeouts, and output caps to detect code issues without executing project scripts or remote rules.

Instructions

Optionally run an installed local ast-grep, Semgrep, or CodeQL analyzer with fixed non-shell arguments, strict path bounds, timeouts, output caps, and redaction. Disabled by default; no project scripts or remote rules are executed.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathsNo
backendYes
patternNo
databaseNo
languageNo
directoryNo
rule_fileNoExisting project-relative ast-grep or Semgrep rule file
query_fileNo
timeout_msNo
max_resultsNo
redact_secretsNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
dataNo
metaYes
errorNo
messageNo
successYes
schema_versionYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv2.0.0

TDQS

B3/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=true, idempotentHint=true, and destructiveHint=false. The description adds genuinely useful context beyond that: only installed analyzers run, no project scripts or remote rules execute, and outputs are bounded by strict path limits, timeouts, output caps, and redaction. This is not a contradiction of the annotations because running an installed read-only analyzer on code is consistent with readOnlyHint.

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

Conciseness3/5

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

Two sentences, but the first is a dense run-on stringing together constraints with commas. The purpose is front-loaded, and the safety caveat is placed second, which is reasonable. However, the 'Optionally' opening and the overloaded first sentence make it harder to parse than it needs to be.

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

Completeness2/5

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

An output schema exists, so return-value explanation is not required, which helps. However, this is a complex 11-parameter tool with three distinct backends and a 9% schema coverage. The description does not explain backend-specific parameter usage (e.g., codeql requires a database, ast-grep uses a pattern), leaving an agent to guess which of the many undocumented parameters to supply for a given backend.

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

Parameters2/5

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

Schema description coverage is only 9% across 11 parameters, so the description must compensate but does not. It vaguely references constraints ('strict path bounds, timeouts, output caps, and redaction') which map to paths, timeout_ms, max_results, and redact_secrets, but it never explains the meaning of backend, pattern, database, language, rule_file, or query_file, nor which parameters apply to which backend.

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 names a specific verb (run), the resource (installed local static analyzers), and enumerates the three supported backends (ast-grep, Semgrep, CodeQL), which distinguishes it from search/query/parse siblings. The leading 'Optionally' is confusing since it implies the tool might not run, and 'fixed non-shell arguments' is jargon-heavy, but the core purpose is clear.

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?

No guidance on when to choose this over the many sibling analysis tools (query_code, search_code, parse_ast, analyze_file). The description only states a safety caveat ('Disabled by default; no project scripts or remote rules are executed') without explaining when this tool is appropriate versus alternatives or what conditions make it available.

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