Skip to main content
Glama

get_course_locations

Read-onlyIdempotent

Retrieve all course location records from Eduframe. Paginate results with optional cursor and per_page parameters.

Instructions

Get all course location records

Input Schema

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

Implementation Reference

  • The handler function for the 'get_course_locations' tool. Fetches all course location records from the API via apiList, logs the response, formats results using formatList, and appends a next-page cursor if available.
    async ({ cursor, per_page }) => {
      try {
        const result = await apiList<EduframeRecord>("/course_locations", { cursor, per_page });
        void logResponse("get_course_locations", { cursor, per_page }, result);
        const toolResult = formatList(result.records, "course locations");
        if (result.nextCursor) {
          toolResult.content.push({ type: "text", text: `\nNext page cursor: ${result.nextCursor}` });
        }
        return toolResult;
      } catch (error) {
        return formatError(error);
      }
    },
  • The schema/input definition for the 'get_course_locations' tool, defining optional 'cursor' (string) and 'per_page' (positive int) parameters with Zod validation.
    {
      description: "Get all course location 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)"),
      },
  • Registration of the 'get_course_locations' tool via server.registerTool within registerCourseLocationTools.
    server.registerTool(
      "get_course_locations",
  • The register function that wraps all course location tool registrations, called from the central tool index.
    export function registerCourseLocationTools(server: McpServer): void {
      server.registerTool(
        "get_course_locations",
        {
          description: "Get all course location 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>("/course_locations", { cursor, per_page });
            void logResponse("get_course_locations", { cursor, per_page }, result);
            const toolResult = formatList(result.records, "course locations");
            if (result.nextCursor) {
              toolResult.content.push({ type: "text", text: `\nNext page cursor: ${result.nextCursor}` });
            }
            return toolResult;
          } catch (error) {
            return formatError(error);
          }
        },
      );
    
      server.registerTool(
        "get_course_location",
        {
          description: "Get a course location record",
          annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true },
          inputSchema: { id: z.number().int().positive().describe("ID of the course location to retrieve") },
        },
        async ({ id }) => {
          try {
            const record = await apiGet<EduframeRecord>(`/course_locations/${id}`);
            void logResponse("get_course_location", { id }, record);
            return formatShow(record, "course location");
          } catch (error) {
            return formatError(error);
          }
        },
      );
    
      server.registerTool(
        "create_course_location",
        {
          description: "Create a course location.",
          annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: false },
          inputSchema: {
            name: z.string().describe("Name of the location where the course is held."),
            address_attributes: z
              .object({
                addressee: z.string().optional().describe("The addressee of the address."),
                address: z.string().describe("Concatenation of the street and house number."),
                address_line2: z.string().optional().describe("A string representing the second line of the address."),
                postal_code: z.string().describe("A string representing the postal code."),
                city: z.string().describe("A string representing the city."),
                state_province: z.string().optional().describe("An letter USA state code."),
                country: z.string().describe("An ISO3166 two-letter country code."),
              })
              .optional(),
          },
        },
        async (body) => {
          try {
            const record = await apiPost<EduframeRecord>("/course_locations", body);
            void logResponse("create_course_location", body, record);
            return formatCreate(record, "course location");
          } catch (error) {
            return formatError(error);
          }
        },
      );
    
      server.registerTool(
        "update_course_location",
        {
          description: "Update a course location.",
          annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: true },
          inputSchema: {
            id: z.number().int().positive().describe("ID of the course location to update"),
            name: z.string().optional().describe("Name of the location where the course is held."),
            address_attributes: z
              .object({
                addressee: z.string().optional().describe("The addressee of the address."),
                address: z.string().optional().describe("Concatenation of the street and house number."),
                address_line2: z.string().optional().describe("A string representing the second line of the address."),
                postal_code: z.string().optional().describe("A string representing the postal code."),
                city: z.string().optional().describe("A string representing the city."),
                state_province: z.string().optional().describe("An letter USA state code."),
                country: z.string().optional().describe("An ISO3166 two-letter country code."),
              })
              .optional(),
          },
        },
        async ({ id, ...body }) => {
          try {
            const record = await apiPatch<EduframeRecord>(`/course_locations/${id}`, body);
            void logResponse("update_course_location", { id, ...body }, record);
            return formatUpdate(record, "course location");
          } catch (error) {
            return formatError(error);
          }
        },
      );
    
      server.registerTool(
        "delete_course_location",
        {
          description: "Delete a course location.",
          annotations: { readOnlyHint: false, destructiveHint: true, idempotentHint: true },
          inputSchema: { id: z.number().int().positive().describe("ID of the course location to delete") },
        },
        async ({ id }) => {
          try {
            const record = await apiDelete<EduframeRecord>(`/course_locations/${id}`);
            void logResponse("delete_course_location", { id }, record);
            return formatDelete(record, "course location");
          } catch (error) {
            return formatError(error);
          }
        },
      );
    }
  • Central registration: registerCourseLocationTools is listed in the tools array and invoked by registerAllTools.
    registerCourseLocationTools,
Behavior3/5

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

Annotations already indicate readOnly, non-destructive, idempotent. The description adds no further behavioral details (e.g., that it supports pagination). It is consistent with annotations, so scores at the baseline due to annotation coverage.

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

Conciseness5/5

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

Single sentence, direct, no unnecessary words. Efficiently communicates the core purpose.

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?

For a simple read-only tool with annotations and clear schema, the description is largely adequate. However, it could be more complete by mentioning that it returns a paginated list, which is implied by the parameters but not stated.

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 covers both parameters fully with descriptions. The description adds no additional meaning beyond 'all' which might conflict with pagination intent, but not significantly. Baseline 3 as schema coverage is 100%.

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 'Get all course location records' clearly states the verb (get), the resource (course location records), and explicitly says 'all', distinguishing it from the sibling tool `get_course_location` which retrieves a single record.

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?

No explicit guidance on when to use this tool versus alternatives like `get_course_location` or how pagination works. The usage is implied by the name and description but lacks explicit 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