Skip to main content
Glama

Get Mental Model by Code

get_model

Retrieve 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

TableJSON Schema
NameRequiredDescriptionDefault
codeYesModel code (e.g., P1, IN3, CO5)

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
codeYes
nameYes
definitionYes
priorityYes
transformationYes

Implementation Reference

  • 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;
    }
  • 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(),
      }),
  • 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;
        }
      );
  • 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);
    }
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description should disclose read-only nature and any constraints. It only states 'Retrieve detailed information,' which is implied but does not explicitly confirm no side effects or limitations such as rate limits.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single sentence, concise and front-loaded. It could be slightly more structured (e.g., bullet points) but is efficient and contains no superfluous information.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's simplicity (one required parameter, output schema present), the description provides enough context for an AI agent to use it. However, it could mention that detailed information is returned, though the output schema likely covers that.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema already provides a pattern and description for the 'code' parameter. The description adds example codes, but with 100% schema coverage, it offers no substantial new meaning beyond the schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb 'Retrieve,' the resource 'HUMMBL mental model,' and the identifier 'code.' It differentiates from siblings like 'list_all_models' and 'get_related_models' by focusing on a single model by code.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

While the description implies use when you have a specific code (e.g., P1, IN3, CO5), it lacks explicit guidance on when not to use it or mentions of alternatives like 'search_models' or 'list_all_models' for broader queries.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/hummbl-dev/mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server