Skip to main content
Glama

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; paid API keys use the plan's remaining quota). 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 the operation read-only, non-destructive, idempotent, and closed-world. The description adds meaningful context beyond those annotations: static analysis without code execution, per-IP rate limits, paid-key quota behavior, and the shape of the returned audit results.

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 description is front-loaded with the core action and remains dense but purposeful. It is slightly less concise than ideal because it lists return fields even though an output schema exists, but the rate-limit and usage-routing details earn their place.

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?

For a static audit tool with two parameters, full schema coverage, annotations, and an output schema, the description is complete. It covers input scope, execution behavior, quota constraints, return payload, and the relevant sibling alternative without omitting anything an agent needs to invoke it correctly.

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 both `content` and `target_type` are already fully documented in the schema. The description restates the accepted input types and analyzer scope but adds little syntax or format detail beyond what the schema provides. Baseline 3 is appropriate when the schema carries parameter semantics.

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 uses a specific verb and resource: 'Run a read-only static security and token-efficiency audit' on Solidity source or MCP configuration files. It lists concrete detection categories and explicitly distinguishes the tool from `check_mcp_poisoning`, so an agent can select it 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 exactly when to use this tool ('source-code and config auditing') and when to use the named alternative ('fast runtime prompt-injection screening'). This gives the agent a clear routing decision between static source/config analysis and runtime screening.

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.

Resources