get_model
Retrieve detailed information about specific HUMMBL mental models using their unique codes to support problem-solving and decision-making processes.
Instructions
Retrieve detailed information about a specific HUMMBL mental model using its code (e.g., P1, IN3, CO5).
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| code | Yes | Model code (e.g., P1, IN3, CO5) |
Implementation Reference
- src/tools/models.ts:53-92 (handler)The MCP tool handler for 'get_model': normalizes input code, fetches model data using getModelByCode, enriches with transformation info, handles errors, and returns structured JSON response.async ({ code }) => { const normalizedCode = code.toUpperCase(); const result = getModelByCode(normalizedCode); if (!isOk(result)) { return { content: [ { type: "text", text: `Model code '${code}' not found in HUMMBL Base120 framework. Valid codes follow the pattern [P|IN|CO|DE|RE|SY][1-20].`, }, ], isError: true, } as const; } const model = result.value; const transformation = Object.values(TRANSFORMATIONS).find((t) => t.models.some((m) => m.code === model.code) ); const payload = { code: model.code, name: model.name, definition: model.definition, priority: model.priority, transformation: transformation?.key ?? null, }; return { content: [ { type: "text", text: JSON.stringify({ model: payload }, null, 2), }, ], structuredContent: payload, } as const; }
- src/tools/models.ts:35-52 (schema)Input and output schemas for 'get_model' tool using Zod: input requires code matching pattern ^(P|IN|CO|DE|RE|SY)\d{1,2}$/i, output includes model details.{ title: "Get Mental Model by Code", description: "Retrieve detailed information about a specific HUMMBL mental model using its code (e.g., P1, IN3, CO5).", inputSchema: z.object({ code: z .string() .regex(/^(P|IN|CO|DE|RE|SY)\d{1,2}$/i) .describe("Model code (e.g., P1, IN3, CO5)"), }), outputSchema: z.object({ code: z.string(), name: z.string(), definition: z.string(), priority: z.number(), transformation: z.string().nullable(), }), },
- src/tools/models.ts:33-93 (registration)Direct registration of the 'get_model' MCP tool via server.registerTool within registerModelTools function.server.registerTool( "get_model", { title: "Get Mental Model by Code", description: "Retrieve detailed information about a specific HUMMBL mental model using its code (e.g., P1, IN3, CO5).", inputSchema: z.object({ code: z .string() .regex(/^(P|IN|CO|DE|RE|SY)\d{1,2}$/i) .describe("Model code (e.g., P1, IN3, CO5)"), }), outputSchema: z.object({ code: z.string(), name: z.string(), definition: z.string(), priority: z.number(), transformation: z.string().nullable(), }), }, async ({ code }) => { const normalizedCode = code.toUpperCase(); const result = getModelByCode(normalizedCode); if (!isOk(result)) { return { content: [ { type: "text", text: `Model code '${code}' not found in HUMMBL Base120 framework. Valid codes follow the pattern [P|IN|CO|DE|RE|SY][1-20].`, }, ], isError: true, } as const; } const model = result.value; const transformation = Object.values(TRANSFORMATIONS).find((t) => t.models.some((m) => m.code === model.code) ); const payload = { code: model.code, name: model.name, definition: model.definition, priority: model.priority, transformation: transformation?.key ?? null, }; return { content: [ { type: "text", text: JSON.stringify({ model: payload }, null, 2), }, ], structuredContent: payload, } as const; } );
- src/server.ts:22-23 (registration)Top-level MCP server registration calls registerModelTools(server), which includes the 'get_model' tool registration.registerModelTools(server); registerMethodologyTools(server);
- src/framework/base120.ts:849-859 (helper)Helper function getModelByCode: performs case-insensitive lookup of MentalModel by code from all loaded models, returns Result type.export function getModelByCode(code: string): Result<MentalModel, DomainError> { const allModels = getAllModels(); const normalizedCode = code.toUpperCase(); const model = allModels.find((m) => m.code === normalizedCode) || null; if (!model) { return err({ type: "NotFound", entity: "MentalModel", code: normalizedCode }); } return ok(model); }