Skip to main content
Glama

Sage Agent x402 Tools

ai_code_security_review

Read-only

Analyzes source code or smart-contract snippets (Solidity, TypeScript, JavaScript, Python, Go, Rust) with Qwen2.5-Coder-32B to return a 0-100 security score, CWE-tagged vulnerabilities, logic bugs, and exact code fixes. Use on raw source code; use security_pre_trade_audit to check a deployed on-chain token contract by address. Read-only, stateless; costs $0.040 Base USDC via x402 (unpaid calls return a v2 quote challenge without charging; invalid inputs return 400 uncharged).

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": {
      "code": "<code>"
    },
    "name": "ai_code_security_review"
  }
}

Input Schema

NameRequiredDescriptionDefault
codeYesSource code or smart-contract snippet to audit for security vulnerabilities and logic bugs.
languageNoOptional programming language hint (e.g. 'solidity', 'typescript', 'python', 'rust', 'go'); auto-inferred if omitted.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.6/5.0
Behavior5/5

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

Beyond the readOnly/openWorld/idempotent annotations, it discloses statelessness, the exact price ($0.040 Base USDC via x402), and two important failure behaviors: unpaid calls return a quote challenge without charging, and invalid inputs return 400 uncharged. That payment and error semantics are exactly the kind of context an agent cannot get from structured fields.

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?

Front-loaded with purpose and outputs, then routes to the alternative, then payment terms. Every clause carries information, though the pricing/payment sentence is dense enough that it slightly compresses readability.

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?

No output schema exists, but the description compensates by naming the return fields (score, CWE tags, logic bugs, fixes). For a two-parameter, stateless analysis tool, an agent has everything needed to decide and 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 parameters are already documented in the schema, including the language auto-inference note. The description adds no additional syntax, format, or size constraints beyond what the schema states, so it sits at the baseline.

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?

States a specific verb ("Analyzes") plus resource (source code / smart-contract snippets), enumerates supported languages, names the underlying model, and lists the concrete outputs (0-100 score, CWE-tagged vulnerabilities, logic bugs, exact fixes). It also explicitly distinguishes itself from security_pre_trade_audit, so an agent can route correctly without opening either 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?

Gives an explicit use case ("raw source code") and an explicit alternative with its selection condition ("use security_pre_trade_audit to check a deployed on-chain token contract by address"). The when/when-not pair is unambiguous.

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.