generate_config
Generate CI-1T integration boilerplate for your chosen framework. Specify framework and use case to receive endpoints, score format, and step-by-step instruction for production-ready code.
Instructions
Generate CI-1T integration boilerplate for a specific framework or language — no API call, no auth, no credits. Response: { framework, use_case, api_base, endpoints, score_format, auth, cost, instruction }. The instruction field tells you how to produce complete, production-ready integration code for the user's stack.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| framework | Yes | Target framework or language (e.g. "fastapi", "express", "django", "flask", "nextjs", "python", "typescript", "go", "rust") | |
| use_case | No | Integration pattern: "single" for single-model monitoring, "fleet" for multi-model fleet evaluation, "guardrail" for CI-as-guardrail (reject/fallback when unstable) |
Implementation Reference
- src/index.ts:909-944 (registration)Tool registration for 'generate_config' — calls server.tool() with name 'generate_config', defines input schema (framework string, optional use_case enum), and provides a description. Registered as a local, no-auth utility tool.
server.tool( "generate_config", "Generate CI-1T integration boilerplate for a specific framework or language — no API call, no auth, no credits. Response: { framework, use_case, api_base, endpoints, score_format, auth, cost, instruction }. The instruction field tells you how to produce complete, production-ready integration code for the user's stack.", { framework: z.string().min(1).max(50).describe('Target framework or language (e.g. "fastapi", "express", "django", "flask", "nextjs", "python", "typescript", "go", "rust")'), use_case: z.enum(["single", "fleet", "guardrail"]).optional().describe('Integration pattern: "single" for single-model monitoring, "fleet" for multi-model fleet evaluation, "guardrail" for CI-as-guardrail (reject/fallback when unstable)'), }, async ({ framework, use_case }) => { const useCase = use_case || "single"; return { content: [ { type: "text" as const, text: JSON.stringify( { framework, use_case: useCase, api_base: "https://collapseindex.org/api", endpoints: { evaluate: { method: "POST", path: "/api/evaluate", body: '{ "scores": [u16, ...] }' }, fleet_evaluate: { method: "POST", path: "/api/fleet-evaluate", body: '{ "nodes": [[u16, ...], ...] }' }, health: { method: "GET", path: "/health", url: `${BASE_URL}/health` }, }, score_format: "Q0.16 unsigned 16-bit integers (0-65535). Convert from float: Math.round(probability * 65535)", auth: "X-API-Key header with ci_... key. Single credential for all endpoints.", cost: "1 credit per episode (evaluate), 1 credit per episode per node (fleet-evaluate). 1,000 free credits on signup.", instruction: `Generate a complete, production-ready ${framework} integration for CI-1T using the "${useCase}" pattern. Include: API client setup, score submission, result parsing, error handling with retries, credit tracking from response (credits_used, credits_remaining), and a working example. Use the real endpoint ${BASE_URL}/api.`, }, null, 2 ), }, ], }; } ); - src/index.ts:916-943 (handler)The handler function for generate_config. Takes framework and use_case parameters, returns a JSON response with boilerplate integration info including API endpoints, score format, auth details, and a dynamic instruction field that tells the user to generate production-ready code for the specified framework/language.
async ({ framework, use_case }) => { const useCase = use_case || "single"; return { content: [ { type: "text" as const, text: JSON.stringify( { framework, use_case: useCase, api_base: "https://collapseindex.org/api", endpoints: { evaluate: { method: "POST", path: "/api/evaluate", body: '{ "scores": [u16, ...] }' }, fleet_evaluate: { method: "POST", path: "/api/fleet-evaluate", body: '{ "nodes": [[u16, ...], ...] }' }, health: { method: "GET", path: "/health", url: `${BASE_URL}/health` }, }, score_format: "Q0.16 unsigned 16-bit integers (0-65535). Convert from float: Math.round(probability * 65535)", auth: "X-API-Key header with ci_... key. Single credential for all endpoints.", cost: "1 credit per episode (evaluate), 1 credit per episode per node (fleet-evaluate). 1,000 free credits on signup.", instruction: `Generate a complete, production-ready ${framework} integration for CI-1T using the "${useCase}" pattern. Include: API client setup, score submission, result parsing, error handling with retries, credit tracking from response (credits_used, credits_remaining), and a working example. Use the real endpoint ${BASE_URL}/api.`, }, null, 2 ), }, ], }; } - src/index.ts:912-915 (schema)Input schema definition for the generate_config tool: 'framework' is a required string (1-50 chars, targeting framework/language), and 'use_case' is an optional enum of 'single'|'fleet'|'guardrail'.
{ framework: z.string().min(1).max(50).describe('Target framework or language (e.g. "fastapi", "express", "django", "flask", "nextjs", "python", "typescript", "go", "rust")'), use_case: z.enum(["single", "fleet", "guardrail"]).optional().describe('Integration pattern: "single" for single-model monitoring, "fleet" for multi-model fleet evaluation, "guardrail" for CI-as-guardrail (reject/fallback when unstable)'), },