Get Mental Model by Code
get_modelRetrieve detailed information on any HUMMBL mental model by entering its code (e.g., P1, IN3, CO5). Get model details quickly.
Instructions
Retrieve detailed information about a specific HUMMBL mental model using its code (e.g., P1, IN3, CO5).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| code | Yes | Model code (e.g., P1, IN3, CO5) |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| code | Yes | ||
| name | Yes | ||
| definition | Yes | ||
| priority | Yes | ||
| transformation | Yes |
Implementation Reference
- src/tools/models.ts:57-96 (handler)The async handler function for the 'get_model' MCP tool. Normalizes the input code, calls getModelByCode() from the base120 framework, finds the associated transformation, and returns the model details (code, name, definition, priority, transformation) as structured content.
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:39-55 (schema)Input and output schema for the 'get_model' tool. Input: code (regex-validated string matching [P|IN|CO|DE|RE|SY][1-20]). Output: code, name, definition, priority, transformation.
{ 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:35-97 (registration)Registration of the 'get_model' tool via server.registerTool() inside registerModelTools(), which is called from src/server.ts:26.
export function registerModelTools(server: McpServer): void { // Tool: Get specific model by code 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/framework/base120.ts:849-859 (helper)The getModelByCode() helper function that looks up a model by code from the in-memory TRANSFORMATIONS data structure, returning a Result<MentalModel, DomainError>.
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); }