scan_clause
Analyze contract clauses for legal risks and receive suggested revisions to improve clarity and compliance.
Instructions
Analyse a single contract clause for risk and get a suggested revision. Cost: $0.005 USDC. Service: contractscan.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| clause_text | Yes | ||
| jurisdiction | No | general |
Implementation Reference
- src/index.ts:166-223 (handler)The 'scan_clause' tool is not hardcoded but dynamically resolved at runtime from a registry. The CallToolRequestSchema handler fetches the registry, finds the tool by name, and executes it using '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), }), }, ], }; } });