Skip to main content
Glama

ChainGuard Web3 Security & DeFi MCP

audit_solidity_or_mcp

Read-onlyIdempotent

Run a read-only static security and token-efficiency audit on Solidity smart contract source code (.sol) or MCP server JSON configuration files. Detects reentrancy, tx.origin auth, unchecked external calls, uninitialized proxies, and redundant prompt token bloat without executing the submitted code (5 free calls/hour per IP or unlimited with X-API-Key). Returns JSON with risk_score (0-100), severity_counts, findings (with remediation patches), and estimated_savings_usd. Use this tool for source-code and config auditing; use check_mcp_poisoning for fast runtime prompt-injection screening.

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": {
      "content": "<content>"
    },
    "name": "audit_solidity_or_mcp"
  }
}

Input Schema

NameRequiredDescriptionDefault
contentYesFull Solidity smart contract source code (`pragma solidity ...`) or JSON/YAML MCP server configuration content to audit statically.
target_typeNoAnalyzer mode: `solidity` for EVM smart contracts, `mcp` for agent configurations, or `auto` to auto-detect from syntax. Defaults to `auto`.auto

Output Schema

NameRequiredDescriptionDefault
findingsNo
risk_scoreYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed4 schema fields changed
    • addedInput schema / properties / content / description
      Added value: +"Full Solidity smart contract source code (`pragma solidity ...`) or JSON/YAML MCP server configuration content to audit statically."
    • addedInput schema / properties / target_type / description
      Added value: +"Analyzer mode: `solidity` for EVM smart contracts, `mcp` for agent configurations, or `auto` to auto-detect from syntax. Defaults to `auto`."
    • addedInput schema / properties / target_type / enum
      Added value: +[
      +  "auto",
      +  "solidity",
      +  "mcp"
      +]
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "properties": {
      +    "findings": {
      +      "type": "array"
      +    },
      +    "risk_score": {
      +      "type": "integer"
      +    }
      +  },
      +  "required": [
      +    "risk_score"
      +  ],
      +  "type": "object"
      +}
  2. First observed

TDQS

A4.6/5.0
Behavior5/5

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

Annotations already declare readOnly/idempotent/non-destructive, yet the description adds context those fields cannot convey: the code is never executed, there is a rate limit of 5 free calls/hour per IP, and unlimited access requires an X-API-Key. Those are exactly the operational facts an agent needs before invoking a third-party audit endpoint.

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 purpose and resource scope are front-loaded, and the sibling routing is placed last where it belongs. The sentence is dense, packing detections, rate limits, and return fields into one long clause, but every element serves retrieval or invocation; only minor tightening is possible.

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?

With an output schema present, the description does not need to explain return values, and annotations cover safety semantics; the description still fills remaining gaps (no code execution, quota, auth). Nothing material for correct invocation is missing for a two-parameter static analyzer.

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 both parameters are documented in place (including the `auto`/`solidity`/`mcp` enum), so the schema carries the semantics. The description restates the same content ('full Solidity source' or 'JSON/YAML MCP server configuration') without adding syntax, size limits, or examples beyond what the schema already provides.

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 description names a specific verb ('run a read-only static security and token-efficiency audit') and two precise resource classes (`.sol` source code and MCP server JSON configs), and enumerates the failure classes it detects. This is enough for an agent to distinguish it from siblings like `check_mcp_poisoning` or `check_eip7702_delegation` without opening the schema.

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

Usage Guidelines5/5

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

It states the use case explicitly ('use this tool for source-code and config auditing') and routes the alternate scenario to a named sibling ('use `check_mcp_poisoning` for fast runtime prompt-injection screening'). The static-vs-runtime distinction gives the agent a clear decision boundary.

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.