Skip to main content
Glama

Audit a path for traversal outside a root

audit_path

Detect path traversal, encoded traversal, and length violations by lexically resolving a supplied path against an absolute root—no filesystem reads.

Instructions

Resolve a caller-supplied path inside an absolute root with pathcage and report traversal, encoded traversal, symlink-independent lexical escapes, and length violations. This is lexical and does not read the filesystem.

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": {
      "path": "<path>"
    },
    "name": "audit_path"
  }
}

Input Schema

NameRequiredDescriptionDefault
pathYes
rootNo
decodeCheckNo
maxPathLengthNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

B3.2/5.0
Behavior3/5

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

With no annotations at all, the description carries the full burden, and it does disclose the most important trait: the check is purely lexical and never touches disk, which tells the agent there are no side effects and no TOCTOU exposure. It also names the finding categories, but omits whether violations are returned as a report or raised as an error, and says nothing about defaults or cost.

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

Conciseness4/5

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

Two dense, front-loaded sentences that map directly onto the tool's two core facts: what is checked and that checking is lexical. The library reference 'with pathcage' adds little for an agent and could be trimmed, but overall there is no filler.

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?

For a four-parameter tool with no annotations and no output schema, the definition leaves too much unstated: the return value/finding format, the meaning of three of four parameters, and the behavior when the optional root is absent. The strong purpose statement does not compensate for the undocumented parameter and return surface.

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 0%, so the four parameters are documented nowhere. The prose only glancingly implies them (root, 'encoded traversal' suggesting decodeCheck, 'length violations' suggesting maxPathLength) but never states what decodeCheck=false does, whether maxPathLength is only applied lexically, or what happens when the optional root is omitted.

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?

States a specific verb and resource ('Resolve a caller-supplied path inside an absolute root') and enumerates exactly what classes of violation it detects: traversal, encoded traversal, lexical symlink-independent escapes, and length violations. An agent can distinguish this from audit_cors, audit_redirect, etc. without opening any schema.

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?

Contains no when-to-use, when-not-to-use, or alternative-tool guidance. The only scoping statement ('This is lexical and does not read the filesystem') is a behavioral limitation, not routing guidance, so the agent must infer that this validates untrusted paths before filesystem use.

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