Skip to main content
Glama
MCP Tool Choice Audit

MCP Tool Choice Audit

by gptenv
README.md
# MCP Tool Choice Audit

An MCP server and paid HTTP endpoint for evaluating user-authored tool-choice fixtures against an MCP `tools/list` snapshot. The service runs a deterministic word-overlap baseline across tool names, titles, and descriptions, then highlights expected tools that are absent, close competitors, and prompts with a lexical mismatch.

This is a cheap first-pass fixture triage tool. It does not call an LLM, connect to an MCP server, execute tools, or predict any model's selection accuracy. Use its results to select ambiguous cases for model-specific evaluation.

## Free and paid

- `preview_case` is free for one prompt.
- `audit_cases` accepts up to 50 prompt cases against a tool list for **$0.01 USDC on Base** via x402.
- Tool lists may be a plain array or a normal MCP `tools/list` response.
- `GET /example` provides a public sample.

## MCP connection

```json
{"mcpServers":{"mcp-tool-choice-audit":{"url":"https://mcp-tool-choice-audit.defcronyke.workers.dev/mcp"}}}
```

## HTTP API

POST `{"tools":[{"name":"search_docs","description":"Find docs by topic"}],"cases":[{"prompt":"find docs about audit logging","expected_tool":"search_docs"}]}` to `/v1/audit` with an x402 V2 client. An unsigned request returns a payment challenge. `/.well-known/x402` and `/openapi.json` describe the endpoint.

## Payment options

Automatic payment is $0.01 USDC on Base to `0x8CDcbCAC0453b1e94aFf0DDB552d409fea6b7F9F`. BTC, Interac e-Transfer, PayPal, or another EVM asset require prior arrangement by emailing `jeremy@jeremycarter.ca`; manual payments cannot be automatically verified or fulfilled. BTC address: `bc1q7x4n86m5u8lkekzlqjwqnx2fdjdzm0elgwuud5`.

Stripe code supports a one-time C$0.50 batch checkout and releases results only after Stripe confirms the paid session, amount, currency, and matching input hash. Configure `STRIPE_SECRET_KEY` from the SaladFinder account as a Cloudflare Worker secret before it is enabled.

## Development

```sh
npm ci
npm test
npm run build
```

## License

MIT.