Skip to main content
Glama

hyperd.contract.audit

Audit any contract before trading. Combines GoPlus, Sourcify, DefiLlama, and on-chain heuristics into a 0-100 risk score with structured findings. Costs $0.10 USDC.

Instructions

Pre-trade contract security audit. Composes GoPlus + Sourcify + DefiLlama protocol recognition + on-chain heuristics into a single 0-100 risk score with structured findings. Use BEFORE interacting with any unfamiliar contract. Costs $0.10 in USDC.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
contractYesContract address to audit
chainNoChain. Default 'base'.

Implementation Reference

  • paidGet helper function that signs and sends x402 payment requests to the hyperD API backend. Used by the hyperd.contract.audit tool handler to call GET /api/contract/audit.
    async function paidGet(
      path: string,
      query: Record<string, string | number | boolean | undefined>,
    ): Promise<unknown> {
      if (!httpClient) {
        throw new Error(WALLET_NOT_CONFIGURED_MSG);
      }
    
      const url = new URL(`${API_BASE}${path}`);
      for (const [k, v] of Object.entries(query)) {
        if (v !== undefined && v !== "" && v !== null) url.searchParams.set(k, String(v));
      }
      return paidRequest("GET", url, undefined);
    }
  • src/server.ts:322-334 (registration)
    Registration of the 'hyperd.contract.audit' tool via server.tool(). Defines tool name, description, input schema (contract address + optional chain), and handler that calls paidGet('/api/contract/audit').
    // hyperd.contract.audit — pre-trade contract security ($0.10)
    server.tool(
      "hyperd.contract.audit",
      "Pre-trade contract security audit. Composes GoPlus + Sourcify + DefiLlama protocol recognition + on-chain heuristics into a single 0-100 risk score with structured findings. Use BEFORE interacting with any unfamiliar contract. Costs $0.10 in USDC.",
      {
        contract: z.string().describe("Contract address to audit"),
        chain: z
          .enum(["base", "ethereum", "polygon", "arbitrum", "optimism", "avalanche", "bnb"])
          .optional()
          .describe("Chain. Default 'base'."),
      },
      async (args) => asText(await paidGet("/api/contract/audit", args)),
    );
  • Input schema for hyperd.contract.audit using Zod validation: 'contract' (required string) and 'chain' (optional enum of supported EVM chains).
    {
      contract: z.string().describe("Contract address to audit"),
      chain: z
        .enum(["base", "ethereum", "polygon", "arbitrum", "optimism", "avalanche", "bnb"])
        .optional()
        .describe("Chain. Default 'base'."),
    },
  • Handler function for hyperd.contract.audit. Async lambda that awaits paidGet('/api/contract/audit', args) and wraps the result via asText().
    async (args) => asText(await paidGet("/api/contract/audit", args)),
Behavior4/5

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

With no annotations, the description carries full burden; it discloses cost ($0.10 USDC) and the composite analysis (GoPlus, Sourcify, DefiLlama, heuristics), giving the agent good behavioral insight into the tool's operation.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two concise sentences that front-load the purpose and key details without any wasted words.

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

Completeness4/5

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

Covers key aspects: purpose, composite sources, risk score range, cost, and usage timing. Lacks details on return format beyond 'structured findings', but given no output schema, this is reasonably complete.

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 description adds no extra meaning beyond what the schema already provides for contract address and chain enum. Baseline of 3 is appropriate.

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 clearly states it performs a contract security audit composing multiple sources into a single risk score, distinguishing it from sibling tools like hyperd.token.security by specifying the pre-trade and composite nature.

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?

Explicitly instructs to use 'BEFORE interacting with any unfamiliar contract' and mentions the $0.10 cost, providing clear context for when to invoke. Does not specify when not to use it.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/hyperd-ai/hyperd-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server