Skip to main content
Glama

scan_contract

Analyze contract text to identify risks, score severity, highlight problematic clauses, and detect missing protections for informed decision-making.

Instructions

Scan a contract for risk. Returns risk score 0-100, risky clauses, red flags, missing protections. Cost: $0.010 USDC. Service: contractscan.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
contract_textYes
jurisdictionNogeneral
contract_typeNo

Implementation Reference

  • The handler dynamically executes 'scan_contract' (or any other tool) by finding it in the fetched registry and invoking it via 'callTool'.
    server.setRequestHandler(CallToolRequestSchema, async (request) => {
      const { name, arguments: args } = request.params;
    
      let registry: Registry;
      try {
        registry = await fetchRegistry();
      } catch (error) {
        return {
          content: [
            {
              type: "text",
              text: JSON.stringify({ error: "Failed to fetch tool registry", detail: String(error) }),
            },
          ],
        };
      }
    
      const tool = registry.tools.find((t) => t.name === name);
      if (!tool) {
        return {
          content: [
            {
              type: "text",
              text: JSON.stringify({
                error: `Tool '${name}' not found`,
                available_tools: registry.tools.map((t) => t.name),
              }),
            },
          ],
        };
      }
    
      try {
        const result = await callTool(tool, args as Record<string, unknown>);
        return {
          content: [
            {
              type: "text",
              text: JSON.stringify(result, null, 2),
            },
          ],
        };
      } catch (error) {
        return {
          content: [
            {
              type: "text",
              text: JSON.stringify({
                error: "Tool call failed",
                tool: name,
                service: tool.service,
                detail: String(error),
              }),
            },
          ],
        };
      }
    });

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/yantrix-ai/yantrix-mcp'

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