Skip to main content
Glama

get_option_of_custom_field

Read-onlyIdempotent

Fetch a custom field option by its ID for a given field slug and parent object type.

Instructions

Get an option of a custom field

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
object_typeYesID of the parent resource
field_slugYesID of the parent resource
idYesID of the custom field option to retrieve

Implementation Reference

  • Handler function for 'get_option_of_custom_field' tool. Calls apiGet to fetch a single custom field option from /custom/{object_type}/fields/{field_slug}/options/{id}, then formats the result with formatShow.
    async ({ object_type, field_slug, id }) => {
      try {
        const record = await apiGet<EduframeRecord>(`/custom/${object_type}/fields/${field_slug}/options/${option_id}`);
        void logResponse("get_option_of_custom_field", { object_type, field_slug, id }, record);
        return formatShow(record, "custom field option");
      } catch (error) {
        return formatError(error);
      }
    },
  • Registration and schema definition for 'get_option_of_custom_field'. Registers the tool with input schema requiring object_type (number), field_slug (number), and id (number).
    server.registerTool(
      "get_option_of_custom_field",
      {
        description: "Get an option of a custom field",
        annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true },
        inputSchema: {
          object_type: z.number().int().positive().describe("ID of the parent resource"),
          field_slug: z.number().int().positive().describe("ID of the parent resource"),
          id: z.number().int().positive().describe("ID of the custom field option to retrieve"),
        },
  • Tool registration via server.registerTool('get_option_of_custom_field', ...) inside registerCustomFieldOptionTools function.
    server.registerTool(
      "get_option_of_custom_field",
      {
        description: "Get an option of a custom field",
        annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true },
        inputSchema: {
          object_type: z.number().int().positive().describe("ID of the parent resource"),
          field_slug: z.number().int().positive().describe("ID of the parent resource"),
          id: z.number().int().positive().describe("ID of the custom field option to retrieve"),
        },
      },
      async ({ object_type, field_slug, id }) => {
        try {
          const record = await apiGet<EduframeRecord>(`/custom/${object_type}/fields/${field_slug}/options/${option_id}`);
          void logResponse("get_option_of_custom_field", { object_type, field_slug, id }, record);
          return formatShow(record, "custom field option");
        } catch (error) {
          return formatError(error);
        }
      },
    );
  • apiGet helper function called by the handler. Performs a GET request to the Eduframe API and returns the parsed JSON response.
    /**
     * Perform a GET request to retrieve a single resource.
     *
     * @param path - API path, e.g. "/leads/1"
     * @param query - Optional query parameters
     */
    export async function apiGet<T>(path: string, query?: Record<string, QueryValue>): Promise<T> {
  • formatShow helper used by the handler to format the retrieved custom field option record as a human-readable text result.
    /**
     * Format the response of a SHOW tool call.
     *
     * @param record - The resource record returned by the API.
     * @param resourceName - Human-readable name of the resource type (e.g. "course").
     */
    export function formatShow(record: EduframeRecord, resourceName: string): CallToolResult {
      return {
        content: [
          {
            type: "text",
            text: `${resourceName}:\n\n${formatJSON(record)}${RESPONSE_LOG_HINT}`,
          },
        ],
      };
    }
Behavior3/5

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

Annotations already declare readOnlyHint=true and idempotentHint=true. Description adds no new behavioral context beyond the name, but does not contradict annotations.

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, front-loaded, and efficient. Could slightly expand to mention retrieval by ID, but not overly verbose.

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?

Adequate for a simple read operation with good annotations, but lacks details like response format, error handling, or relationship to parent custom field.

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%, so the description adds no additional meaning to parameters. The parameter descriptions in the schema are present but identical and potentially misleading; however, the tool description does not clarify this.

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 action ('Get') and the resource ('an option of a custom field'), distinguishing it from siblings like 'get_options_of_custom_field' (plural) and other CRUD operations on options.

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 (e.g., 'get_options_of_custom_field' for listing). No prerequisites or context provided.

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