Skip to main content
Glama

get_categories

Read-onlyIdempotent

Fetch categories from Eduframe with support for pagination, published filter, and sorting by position.

Instructions

Get all category records

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
cursorNoCursor for fetching the next page of results
per_pageNoNumber of results per page (default: 25)
publishedNoShow only published categories
sortNoSort the results. Can change order by using `<sort_by>:<direction>` where `<direction>` is either `asc` or `desc`

Implementation Reference

  • Registration of the 'get_categories' tool via server.registerTool with the name 'get_categories'. Registers the schema and the handler callback.
    export function registerCategorieTools(server: McpServer): void {
      server.registerTool(
        "get_categories",
        {
          description: "Get all category records",
          annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true },
          inputSchema: {
            cursor: z.string().optional().describe("Cursor for fetching the next page of results"),
            per_page: z.number().int().positive().optional().describe("Number of results per page (default: 25)"),
            published: z.enum(["published"]).optional().describe("Show only published categories"),
            sort: z
              .array(z.enum(["position:asc", "position:desc"]))
              .optional()
              .describe(
                "Sort the results. Can change order by using `<sort_by>:<direction>` where `<direction>` is either `asc` or `desc`",
              ),
          },
        },
        async ({ cursor, per_page, published, sort }) => {
          try {
            const result = await apiList<EduframeRecord>("/categories", { cursor, per_page, published, sort });
            void logResponse("get_categories", { cursor, per_page, published, sort }, result);
            const toolResult = formatList(result.records, "categories");
            if (result.nextCursor) {
              toolResult.content.push({ type: "text", text: `\nNext page cursor: ${result.nextCursor}` });
            }
            return toolResult;
          } catch (error) {
            return formatError(error);
          }
        },
      );
  • Input schema for 'get_categories' tool defining cursor, per_page, published, and sort parameters using Zod validation.
    {
      description: "Get all category records",
      annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true },
      inputSchema: {
        cursor: z.string().optional().describe("Cursor for fetching the next page of results"),
        per_page: z.number().int().positive().optional().describe("Number of results per page (default: 25)"),
        published: z.enum(["published"]).optional().describe("Show only published categories"),
        sort: z
          .array(z.enum(["position:asc", "position:desc"]))
          .optional()
          .describe(
            "Sort the results. Can change order by using `<sort_by>:<direction>` where `<direction>` is either `asc` or `desc`",
          ),
      },
  • Handler function for 'get_categories' tool. Calls apiList to GET /categories, logs the response, formats results with formatList, and returns paginated data with next cursor.
    async ({ cursor, per_page, published, sort }) => {
      try {
        const result = await apiList<EduframeRecord>("/categories", { cursor, per_page, published, sort });
        void logResponse("get_categories", { cursor, per_page, published, sort }, result);
        const toolResult = formatList(result.records, "categories");
        if (result.nextCursor) {
          toolResult.content.push({ type: "text", text: `\nNext page cursor: ${result.nextCursor}` });
        }
        return toolResult;
      } catch (error) {
        return formatError(error);
      }
    },
  • The apiList helper function used by get_categories to perform a paginated GET request to the API.
    export async function apiList<T>(path: string, query?: Record<string, QueryValue>): Promise<ListResult<T>> {
      const { token } = getConfig();
      const url = buildUrl(path, query);
    
      const response = await fetch(url.toString(), {
        method: "GET",
        headers: buildHeaders(token),
      });
    
      await checkResponse(response);
    
      const records = (await response.json()) as T[];
      const nextCursor = parseNextCursor(response.headers.get("Link"));
    
      return { records, nextCursor };
    }
  • Import of registerCategorieTools which registers the get_categories tool.
    import { registerCategorieTools } from "./categories";
Behavior2/5

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

Annotations already cover readOnly, idempotent, non-destructive. Description adds no behavioral details like pagination or filtering – minimal extra value.

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

Conciseness3/5

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

Extremely concise (4 words) but lacks structure. Single sentence does not leverage space to add value; could expand with key details.

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

Completeness2/5

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

No output schema and 4 parameters – description fails to explain pagination, filtering, or what a 'category record' contains. Incomplete for practical use.

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% (all 4 params have descriptions). Baseline 3 is appropriate since description adds nothing beyond schema's own documentation.

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?

Description clearly states 'Get all category records' – a specific verb and resource. It distinguishes from siblings like 'get_category' and CRUD tools.

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 on when to use this tool vs alternatives (e.g., 'get_category' for a single record). Agent has no context to make informed choice.

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