Skip to main content
Glama

get_credit_categories

Read-onlyIdempotent

Retrieve all credit categories from the Eduframe system. Use optional pagination parameters to control the number of results per page.

Instructions

Get all credit category records

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
cursorNoCursor for fetching the next page of results
per_pageNoNumber of results per page (default: 25)

Implementation Reference

  • Handler function that registers and implements the 'get_credit_categories' tool. It calls the Eduframe API's /credit_categories endpoint (via apiList), logs the response, formats the results, and handles pagination via cursor.
    export function registerCreditCategorieTools(server: McpServer): void {
      server.registerTool(
        "get_credit_categories",
        {
          description: "Get all credit 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)"),
          },
        },
        async ({ cursor, per_page }) => {
          try {
            const result = await apiList<EduframeRecord>("/credit_categories", { cursor, per_page });
            void logResponse("get_credit_categories", { cursor, per_page }, result);
            const toolResult = formatList(result.records, "credit 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 the tool: optional 'cursor' (string) for pagination and optional 'per_page' (positive integer) for page size.
    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)"),
    },
  • Registration of all tools including registerCreditCategorieTools in the tools array, which is then called by registerAllTools to register them on the MCP server.
    const tools: Array<(server: McpServer) => void> = [
      registerAccountTools,
      registerAffiliationTools,
      registerAttendanceTools,
      registerAuthenticationTools,
      registerCatalogProductTools,
      registerCatalogVariantTools,
      registerCategorieTools,
      registerCertificateTools,
      registerCommentTools,
      registerCourseLocationTools,
      registerCourseTabTools,
      registerCourseVariantTools,
      registerCourseTools,
      registerCreditCategorieTools,
      registerCreditTools,
      registerCustomAssociationTools,
      registerCustomFieldOptionTools,
      registerCustomObjectTools,
      registerCustomRecordTools,
      registerDiscountCodeTools,
      registerEditionDescriptionSectionTools,
      registerEducatorTools,
      registerEmailTools,
      registerEnrollmentTools,
      registerGradeTools,
      registerInvoiceVatTools,
      registerInvoiceTools,
      registerLabelTools,
      registerLeadTools,
      registerMaterialGroupTools,
      registerMaterialTools,
      registerMeetingLocationTools,
      registerMeetingTools,
      registerOrderTools,
      registerOrganizationTools,
      registerPaymentMethodTools,
      registerPaymentOptionTools,
      registerPaymentTools,
      registerPlannedCourseTools,
      registerPlanningAttendeeTools,
      registerPlanningConflictTools,
      registerPlanningEventTools,
      registerPlanningLocationTools,
      registerPlanningMaterialTools,
      registerPlanningRequiredTeacherGroupAttendeeTools,
      registerPlanningTeacherTools,
      registerProgramEditionTools,
      registerProgramElementTools,
      registerProgramEnrollmentTools,
      registerProgramPersonalProgramElementTools,
      registerProgramProgramTools,
      registerReferralTools,
      registerSignupQuestionTools,
      registerTaskTools,
      registerTeacherEnrollmentTools,
      registerTeacherRoleTools,
      registerTeacherTools,
      registerTheseTools,
      registerUserTools,
      registerWebhookNotificationTools,
      registerWebhookTools,
    ];
    
    export function registerAllTools(server: McpServer): void {
      for (const register of tools) {
        register(server);
      }
    }
  • Helper function apiList used by the tool handler to perform a paginated GET request to the Eduframe API. Returns typed records and a nextCursor for pagination.
    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 };
    }
  • Helper function formatList used by the tool handler to format the API response into a human-readable CallToolResult.
    export function formatList(records: EduframeRecord[], resourceName: string): CallToolResult {
      if (records.length === 0) {
        return {
          content: [
            {
              type: "text",
              text: `No ${resourceName} found.`,
            },
          ],
        };
      }
    
      return {
        content: [
          {
            type: "text",
            text: `Found ${records.length} ${resourceName}:\n\n${formatJSON(records)}${RESPONSE_LOG_HINT}`,
          },
        ],
      };
    }
Behavior2/5

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

Annotations already indicate read-only and idempotent behavior. The description adds no additional behavioral context (e.g., pagination, ordering, or that it returns all records iteratively).

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?

Single sentence is efficient and front-loaded with the core action. However, it is overly brief and lacks helpful structure like bullet points or warnings, which would improve usability.

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 is provided, yet the description fails to explain what fields the returned records contain. Pagination behavior is implied by parameters but not stated, leaving the agent with incomplete context.

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% with descriptions for both parameters. The description does not add further meaning beyond the schema, so baseline of 3 is appropriate.

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?

Description clearly states the verb 'Get' and the resource 'credit category records', making the tool's purpose unambiguous. It is distinct from siblings like get_categories which deals with different record types.

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 versus alternatives; no exclusions or context provided. Given the lack of sibling tools for credit categories, this is still a gap for optimal selection.

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