Skip to main content
Glama

Scan an MCP server before connecting (metered)

scan_mcp_server

Check an MCP server BEFORE you connect to it. Asks the server to introduce itself and list its tools, then analyzes the text it hands an agent: tool names, descriptions, parameter schemas and server instructions. Catches tool poisoning (hidden directives that point the agent at private keys or at an agent config file), parameters whose real purpose is to carry secrets or your conversation out, standing orders about ANOTHER server's tools (cross-server shadowing), and invisible-unicode payloads. Returns a verdict with the exact tool and line as evidence, plus a hash of what was advertised, so a server that changes its tools later does not inherit the old verdict. Metered like scan_artifact: an X-API-Key with credits, or pay per call over x402 at POST https://lazaretto.dev/v1/scan with target type mcp_server ($0.03 USDC on Base, no signup).

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": {
      "url": "<url>"
    },
    "name": "scan_mcp_server"
  }
}

Input Schema

NameRequiredDescriptionDefault
urlYesThe server's https endpoint, e.g. https://example.com/mcp. Streamable HTTP and SSE replies are both read.

Output Schema

NameRequiredDescriptionDefault
riskYes`unknown` appears only with verdict `error`: the scan did not finish, so no level is asserted. It is not a clear result.
verdictYes
findingsNo
confidenceYes
disclaimerNo
scanned_atNo
attestationNoCompact JWS over the verdict, verifiable offline against /.well-known/jwks.json.
target_hashNoSHA-256 over the advertised tool set, so you can tell whether it changed since the scan.
risk_summaryNo
rules_versionNo
tool_fingerprintNoHashes of what the server tells an agent: one per tool and one over all of them. Keep `sha256` when you approve a server and compare it on a later scan; a different value means its tools changed since, and the keys of `tools` whose hash differs say which. `partial` means a cap cut the read.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changed
    • addedOutput schema / properties / risk / description
      Added value: +"`unknown` appears only with verdict `error`: the scan did not finish, so no level is asserted. It is not a clear result."
    • changedOutput schema / properties / risk / enum
      Previous value: -[
      -  "critical",
      -  "high",
      -  "medium",
      -  "low",
      -  "none"
      -]New value: +[
      +  "critical",
      +  "high",
      +  "medium",
      +  "low",
      +  "none",
      +  "unknown"
      +]
  2. Changed1 schema field changed
    • addedOutput schema / properties / tool_fingerprint
      Added value: +{
      +  "description": "Hashes of what the server tells an agent: one per tool and one over all of them. Keep `sha256` when you approve a server and compare it on a later scan; a different value means its tools changed since, and the keys of `tools` whose hash differs say which. `partial` means a cap cut the read.",
      +  "properties": {
      +    "instructions": {
      +      "description": "SHA-256 of the server instructions, when it sets any.",
      +      "type": "string"
      +    },
      +    "partial": {
      +      "type": "boolean"
      +    },
      +    "sha256": {
      +      "type": "string"
      +    },
      +    "tools": {
      +      "additionalProperties": {
      +        "type": "string"
      +      },
      +      "description": "Tool name to SHA-256. A name that is not a plain identifier is replaced by tool-<hash>.",
      +      "type": "object"
      +    }
      +  },
      +  "type": "object"
      +}
  3. Added

TDQS

A4.1/5.0
Behavior5/5

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

Goes well beyond the annotations: it discloses that the tool makes an outbound request to the given endpoint, what it reads (tool names, descriptions, parameter schemas, server instructions), the shape of the result (verdict with tool and line as evidence), and the hash that prevents stale verdict reuse. It also states the authentication and cost model (X-API-Key with credits, or x402 pay-per-call at $0.03 USDC), which the annotations say nothing about.

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?

The pre-connection timing constraint and the capability list are front-loaded, and each detection category is named concretely rather than hand-waved. The final metering sentence is dense but carries genuinely decision-relevant payment information; a small amount of parenthetical detail could be trimmed.

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

Completeness5/5

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

Despite an output schema existing, the description still tells the agent the shape of the return (verdict plus evidence plus hash), which is the key thing needed to interpret results. With one fully documented parameter, network behavior disclosed, and pricing stated, nothing an agent needs before calling is missing.

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 coverage is 100% and the single url parameter is already documented with an example and a note that Streamable HTTP and SSE replies are both read. The description adds only the framing that the URL is the target of the scan; it introduces no syntax or format detail the schema lacks, so the baseline of 3 applies.

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?

States a specific verb and resource ('Check an MCP server', 'list its tools, then analyzes the text'), and enumerates exactly what classes of problem it detects. It differentiates itself from scan_artifact only indirectly (via the metering analogy) and never clarifies how it relates to the sibling check_mcp_tools, so an agent still has to guess at that boundary.

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?

Gives a clear timing condition ('BEFORE you connect to it') and implies the pre-connection audit use case with concrete examples of what it catches. It offers no explicit exclusions or statement of when check_mcp_tools or find_mcp_servers would be the better choice.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.