x402-path-validator
x402-path-validator: 路径安全校验——拒绝 traversal(..)/NUL/绝对路径逃逸,返回规范化相对路径。文件系统操作前的防护工具。
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| base | No | ||
| path | No |
x402-path-validator: 路径安全校验——拒绝 traversal(..)/NUL/绝对路径逃逸,返回规范化相对路径。文件系统操作前的防护工具。
| Name | Required | Description | Default |
|---|---|---|---|
| base | No | ||
| path | No |
Changes observed during successful MCP inspections.
Input schema / properties / base / descriptionRemoved value: -"Base to process"Input schema / properties / path / descriptionRemoved value: -"Path to process"Input schema / properties / baseAdded value: +{
+ "description": "Base to process",
+ "type": "string"
+}Input schema / properties / pathAdded value: +{
+ "description": "Path to process",
+ "type": "string"
+}Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations the description carries the full burden, and it does disclose real behavior: which inputs are rejected and that a normalized relative path is returned. It omits how rejection is signalled (thrown error vs. error return) and whether the operation is pure/read-only, which keeps it out of 5 territory.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Two tightly packed sentences, front-loaded with the tool name and core purpose, then the guard-tool context. Efficient overall, with only minor waste in repeating the tool name as a prefix already present in the name field.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a 2-parameter tool with no annotations, no output schema, and no schema descriptions, the description covers purpose, rejection rules, and output shape, but leaves 'base' semantics and the failure mode unspecified. Adequate as a minimum-viable definition, not complete.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 0% for both parameters and the description never defines them. 'path' can be inferred from the context, but 'base' — clearly the containment root the escape check resolves against — is entirely unexplained, leaving the caller to guess its role relative to the returned normalized path.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description states a specific verb+resource ('path safety validation') and enumerates the exact threat classes it rejects — traversal (..), NUL bytes, absolute-path escape — plus its output ('normalized relative path'). That is far more concrete than a name restatement, though it does not explicitly distinguish itself from other validator-family siblings in the catalog.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
It gives a clear usage context: 'a guard tool before filesystem operations' tells the agent when to call it. It stops short of naming alternatives or stating when it should be skipped (e.g., for already-trusted paths), so it does not reach the explicit when/when-not bar of a 5.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Add one secure layer between your agents and this server.