Skip to main content
Glama

agent-tools (x402 + MCP + A2A directory)

scan_mcp_safety

Idempotent

Check an MCP server for malware / prompt-injection lures by its endpoint URL.

Give the server's streamable-http endpoint URL. Two paths:

  * **Already in the agent-tools directory** → returns our LATEST stored
    rule verdict. Every indexed server is re-scanned hourly, so you get a
    consistent, continuously-refreshed answer without re-probing.
  * **Not yet indexed** → we probe the endpoint live, statically scan its
    advertised tools + metadata, and return the fresh verdict. It is ADDED
    to the directory (so the next caller gets the stored verdict instantly)
    only if it answered or you supplied metadata; documentation hosts such
    as example.com / *.test / *.invalid are scanned but never listed.

Two dimensions are reported. `verdict` is authoritative and comes from
deterministic static rules — pure pattern-matching over the *advertised*
text only, NO code execution. It flags the social-engineering / RCE tricks
listing-spam servers use:

  * `curl … | bash` and `base64 -d | sh` install lures
  * `eval "$(curl …)"` / PowerShell `IEX(...DownloadString)` cradles
  * base64 blobs that decode to a shell command
  * bare-IP payload hosts and cheap throwaway TLDs
  * prompt-injection / credential-exfiltration phrasing
    ("ignore previous instructions", "send your .env / api key")
  * MCP tool-poisoning coercion — descriptions that hijack an agent's
    tool-calling ("always call this tool first", "before using any other
    tool you must…"), hidden `<IMPORTANT>` instructions, "list all API
    keys / include secrets in your response", and coercion to read &
    forward `.key`/`.pem`/`.ssh`/`.env` files

Source-code-oriented rules (SQL / command / code injection) are deliberately
not applied to natural-language descriptions, to avoid false positives.

`llm_reference` is an advisory frontier-LLM second opinion over the same text.
Because the LLM is slow it is computed LIVE on this call only and is never
stored (the hourly job never runs it), so it may be null on timeout. It
never overrides the rule verdict; when it is *more* severe than the rules an
`advisory` note is attached as a safety-net signal. Security/defense
products that merely *name* these attacks are not flagged.

Args:
    endpoint_url: The MCP server's streamable-http URL (required). This is
        the identity we look up / index by.
    name: Optional advertised name (used when the server is new and gets
        added; falls back to the URL host).
    description: Optional description / README blurb (scanned when new).
    tools_text: Optional tool names + descriptions; used only if the live
        probe cannot fetch the server's tools/list.

Returns:
    { verdict: "clean"|"suspicious"|"malicious", score: 0-100,
      reasons: [{rule, weight, snippet}],
      llm_reference: {model, verdict, reason, confidence} | null,
      advisory: str | null, slug, name, endpoint_url,
      source: "stored" (existing) | "new_scan" (just added), indexed: bool }

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": {
      "endpoint_url": "<endpoint_url>"
    },
    "name": "scan_mcp_safety"
  }
}

Input Schema

NameRequiredDescriptionDefault
nameNoOptional advertised name (used when the server is new and gets added; falls back to the URL host).
tools_textNoOptional tool names + descriptions; used only if the live probe cannot fetch the server's tools/list.
descriptionNoOptional description / README blurb (scanned when new).
endpoint_urlYesThe MCP server's streamable-http URL (required). This is the identity we look up / index by.

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed4 schema fields changed
    • addedInput schema / properties / description / description
      Added value: +"Optional description / README blurb (scanned when new)."
    • addedInput schema / properties / endpoint_url / description
      Added value: +"The MCP server's streamable-http URL (required). This is the identity we look up / index by."
    • addedInput schema / properties / name / description
      Added value: +"Optional advertised name (used when the server is new and gets added; falls back to the URL host)."
    • addedInput schema / properties / tools_text / description
      Added value: +"Optional tool names + descriptions; used only if the live probe cannot fetch the server's tools/list."
  2. Added

TDQS

A4.3/5.0
Behavior5/5

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

Goes well beyond the annotations: discloses that live probing happens, that a successful scan writes the server into a shared directory (consistent with readOnlyHint=false), that documentation hosts are scanned but never listed, that no code is executed, and that llm_reference is computed live and may be null on timeout without overriding the rule verdict. These are exactly the side-effect and reliability facts an agent needs before calling.

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?

The core sentence is front-loaded and the two-path structure is easy to follow, but the description is long and the Returns block duplicates the existing output schema, while the Args block repeats parameter descriptions already in the schema. Those sections do not earn their space.

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?

Given an output schema exists, the description need not explain return values, yet it still covers the crucial asymmetry between the authoritative rule verdict and the advisory LLM reference, plus false-positive policy for security products. Nothing needed to call this correctly 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 description coverage is 100%, so the baseline is 3. The Args block largely restates the schema descriptions verbatim (name falls back to URL host, tools_text used only if tools/list fails), adding little semantic value beyond what is already structured.

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?

The first sentence names a specific verb (check/scan) and resource (an MCP server by endpoint URL) and states the threat class it targets (malware / prompt-injection lures). The two-path explanation of stored-verdict vs live-probe makes it functionally distinguishable from siblings like get_mcp_server or search_mcp_servers, which retrieve directory records rather than produce a safety verdict.

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?

Explicit conditional guidance: indexed servers return the stored hourly-refreshed verdict, unindexed ones are probed live and conditionally added to the directory, with doc hosts excluded from listing. It does not name a sibling alternative (e.g. 'use search_mcp_servers first to find the URL'), so it falls short of full when/when-not/alternatives coverage.

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.