Skip to main content
Glama

get_material_group

Read-onlyIdempotent

Retrieve a material group record by specifying its unique ID. Returns the group details from the Eduframe system.

Instructions

Get a material group record

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesID of the material group to retrieve

Implementation Reference

  • The handler for the 'get_material_group' tool. Registered via server.registerTool('get_material_group', ...). It accepts an id parameter, calls apiGet to fetch the material group from /material_groups/{id}, logs the response, and formats the result using formatShow.
    server.registerTool(
      "get_material_group",
      {
        description: "Get a material group record",
        annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true },
        inputSchema: { id: z.number().int().positive().describe("ID of the material group to retrieve") },
      },
      async ({ id }) => {
        try {
          const record = await apiGet<EduframeRecord>(`/material_groups/${id}`);
          void logResponse("get_material_group", { id }, record);
          return formatShow(record, "material group");
        } catch (error) {
          return formatError(error);
        }
      },
    );
  • Input schema and metadata for the 'get_material_group' tool. The schema defines a single required parameter 'id' (positive integer) and sets annotations: readOnlyHint=true, destructiveHint=false, idempotentHint=true.
    {
      description: "Get a material group record",
      annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true },
      inputSchema: { id: z.number().int().positive().describe("ID of the material group to retrieve") },
  • The registerAllTools function iterates over all tool registration functions, including registerMaterialGroupTools which registers the 'get_material_group' tool (along with other material group tools).
    export function registerAllTools(server: McpServer): void {
      for (const register of tools) {
        register(server);
      }
    }
  • The apiGet helper function used by the handler. It performs a GET request to the specified API path, handles response parsing and error checking.
    export async function apiGet<T>(path: string, query?: Record<string, QueryValue>): Promise<T> {
      const { token } = getConfig();
      const url = buildUrl(path, query);
    
      const response = await fetch(url.toString(), {
        method: "GET",
        headers: buildHeaders(token),
      });
    
      return handleResponse<T>(response);
    }
    
    /**
     * Perform a POST request to create a resource.
     *
     * @param path - API path, e.g. "/leads"
     * @param body - Request body
     */
    export async function apiPost<T>(path: string, body: unknown): Promise<T> {
      const { token } = getConfig();
      const url = buildUrl(path);
    
      const response = await fetch(url.toString(), {
        method: "POST",
        headers: buildHeaders(token),
        body: JSON.stringify(body),
      });
    
      return handleResponse<T>(response);
    }
    
    /**
     * Perform a PUT request to update a resource.
     *
     * @param path - API path, e.g. "/leads/1"
     * @param body - Request body
     */
    export async function apiPut<T>(path: string, body: unknown): Promise<T> {
      const { token } = getConfig();
      const url = buildUrl(path);
    
      const response = await fetch(url.toString(), {
        method: "PUT",
        headers: buildHeaders(token),
        body: JSON.stringify(body),
      });
    
      return handleResponse<T>(response);
    }
    
    /**
     * Perform a PATCH request to partially update a resource.
     *
     * @param path - API path, e.g. "/leads/1"
     * @param body - Request body
     */
    export async function apiPatch<T>(path: string, body: unknown): Promise<T> {
      const { token } = getConfig();
      const url = buildUrl(path);
    
      const response = await fetch(url.toString(), {
        method: "PATCH",
        headers: buildHeaders(token),
        body: JSON.stringify(body),
      });
    
      return handleResponse<T>(response);
    }
    
    /**
     * Perform a DELETE request to remove a resource.
     *
     * @param path - API path, e.g. "/leads/1"
     */
    export async function apiDelete<T>(path: string): Promise<T> {
      const { token } = getConfig();
      const url = buildUrl(path);
    
      const response = await fetch(url.toString(), {
        method: "DELETE",
        headers: buildHeaders(token),
      });
    
      return handleResponse<T>(response);
    }
Behavior2/5

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

The annotations already declare readOnlyHint=true, destructiveHint=false, and idempotentHint=true. The description adds no behavioral context beyond these annotations; it does not mention what happens if the ID does not exist, any potential restrictions, or response format. It simply repeats the action implied by the name.

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 extremely concise at one short sentence. No unnecessary words. However, it could be slightly more informative without losing conciseness, e.g., 'Get a material group record by its ID.'

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

Completeness3/5

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

Given that there is no output schema, the description does not explain what the tool returns. It is a simple retrieval tool, but the lack of any mention of return format or fields leaves a gap. For a tool with 1 parameter and clear annotations, it is minimally adequate but not complete.

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?

Schema coverage is 100%, and the schema already describes the 'id' parameter. The description does not add any additional meaning beyond what is in the schema. Baseline score of 3 is appropriate as the description is neither harmful nor helpful.

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

Purpose4/5

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

The description 'Get a material group record' clearly states the action (Get) and the resource (material group record). It distinguishes from the sibling 'get_material_groups' (plural) implicitly by using singular, but does not explicitly mention that it retrieves a single record by ID. It is specific and clear enough for an AI agent to understand the basic purpose.

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

Usage Guidelines2/5

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

No guidance is provided on when to use this tool versus alternatives like create_material_group, update_material_group, or get_material_groups. There is no mention of prerequisites or conditions for use. The description is entirely silent on usage context.

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/martijnpieters/eduframe-mcp'

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