Skip to main content
Glama
Project Scope MCP Server

Project Scope MCP Server

scan_file_for_threats

Deep-scans a single file for shell, SQL, path, template and prompt injection threats, returning exact line numbers and risk levels so generated or uploaded code is validated before execution.

Instructions

Deep-scan a single file for all 5 threat types (shell, SQL, path, template, prompt injection). Returns exact line numbers and risk levels. Use when generating new code or processing uploaded files to ensure safety before execution.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "filePath": "<filePath>"
    },
    "name": "scan_file_for_threats"
  }
}

Input Schema

NameRequiredDescriptionDefault
modeNoValidation mode (default: strict)
filePathYesPath to the file to scan
sensitivityNoDetection sensitivity (default: high)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A4/5.0
Behavior3/5

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

No annotations exist, so the description carries the burden. It usefully discloses output content ('exact line numbers and risk levels') and the deep-scan depth, but says nothing about whether scanning executes the file, cost/latency, or that it is a read-only operation with no side effects.

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?

Three tight sentences, capability first, return shape second, usage trigger third. No redundant restatement of the name or filler wording.

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?

With no output schema, the description compensates by summarizing the return (line numbers and risk levels). With no annotations, it should also disclaim side-effect/read-only behavior and rough cost, which is the one remaining gap for a scanning tool.

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

Parameters3/5

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

Schema description coverage is 100%, so filePath, mode, and sensitivity are already documented at the field level. The description adds no extra meaning about what strict vs advisory mode does or how sensitivity shifts findings, leaving it at the baseline for high-coverage schemas.

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

Purpose5/5

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

Specific verb and scope: 'Deep-scan a single file for all 5 threat types (shell, SQL, path, template, prompt injection)' names the resource, the depth, and enumerates the coverage. 'Single file' implicitly contrasts with the repo-level sibling, so an agent can select without opening either schema.

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

Usage Guidelines4/5

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

'Use when generating new code or processing uploaded files to ensure safety before execution' gives a clear trigger context. It does not explicitly name when to prefer scan_repo_for_threats or the narrower detect_* tools, so the routing is implied rather than stated.

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