Skip to main content
Glama

create_program

Create a program in Eduframe by specifying its name, category, and cost scheme. Optionally set price, publish status, and labels.

Instructions

Create a program

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYesName of the program.
category_idYesIdentifier of the category of the program.
cost_schemeYesHow should the program be paid by default.
costNoThe price to be paid for this program. Required if cost_scheme is student (default value) or order.
is_publishedNoBoolean representing the publishable status of the program.
label_idsNoIDs of the labels
customNo
custom_associationsNo
course_tab_contents_attributesNo

Implementation Reference

  • The handler function for the 'create_program' tool. It uses zod for input validation, calls apiPost('/program/programs', body) to create a program via the Eduframe API, and returns the formatted result.
    server.registerTool(
      "create_program",
      {
        description: "Create a program",
        annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: false },
        inputSchema: {
          name: z.string().describe("Name of the program."),
          category_id: z.number().int().describe("Identifier of the category of the program."),
          cost_scheme: programProgramCostSchemeEnum.describe("How should the program be paid by default."),
          cost: z
            .number()
            .int()
            .optional()
            .describe(
              "The price to be paid for this program. Required if cost_scheme is student (default value) or order.",
            ),
          is_published: z.boolean().optional().describe("Boolean representing the publishable status of the program."),
          label_ids: z.array(z.number().int()).optional().describe("IDs of the labels"),
          custom: z.record(z.unknown()).optional(),
          custom_associations: z.record(z.unknown()).optional(),
          course_tab_contents_attributes: z
            .array(
              z.object({
                content: z.string().describe("The HTML content of the course tab."),
                course_tab_id: z.number().int().describe("Unique identifier of the course tab."),
              }),
            )
            .optional(),
        },
      },
      async (body) => {
        try {
          const record = await apiPost<EduframeRecord>("/program/programs", body);
          void logResponse("create_program", body, record);
          return formatCreate(record, "program program");
        } catch (error) {
          return formatError(error);
        }
      },
    );
  • The input schema for 'create_program' defining required fields (name, category_id, cost_scheme) and optional fields (cost, is_published, label_ids, custom, custom_associations, course_tab_contents_attributes).
    {
      description: "Create a program",
      annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: false },
      inputSchema: {
        name: z.string().describe("Name of the program."),
        category_id: z.number().int().describe("Identifier of the category of the program."),
        cost_scheme: programProgramCostSchemeEnum.describe("How should the program be paid by default."),
        cost: z
          .number()
          .int()
          .optional()
          .describe(
            "The price to be paid for this program. Required if cost_scheme is student (default value) or order.",
          ),
        is_published: z.boolean().optional().describe("Boolean representing the publishable status of the program."),
        label_ids: z.array(z.number().int()).optional().describe("IDs of the labels"),
        custom: z.record(z.unknown()).optional(),
        custom_associations: z.record(z.unknown()).optional(),
        course_tab_contents_attributes: z
          .array(
            z.object({
              content: z.string().describe("The HTML content of the course tab."),
              course_tab_id: z.number().int().describe("Unique identifier of the course tab."),
            }),
          )
          .optional(),
      },
  • The 'registerProgramProgramTools' function registers all program-related tools (including 'create_program') on the MCP server via server.registerTool().
    export function registerProgramProgramTools(server: McpServer): void {
      server.registerTool(
        "get_programs",
        {
          description: "Get all programs",
          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>("/program/programs", { cursor, per_page });
            void logResponse("get_programs", { cursor, per_page }, result);
            const toolResult = formatList(result.records, "program programs");
            if (result.nextCursor) {
              toolResult.content.push({ type: "text", text: `\nNext page cursor: ${result.nextCursor}` });
            }
            return toolResult;
          } catch (error) {
            return formatError(error);
          }
        },
      );
    
      server.registerTool(
        "get_program",
        {
          description: "Get a program",
          annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true },
          inputSchema: { id: z.number().int().positive().describe("ID of the program program to retrieve") },
        },
        async ({ id }) => {
          try {
            const record = await apiGet<EduframeRecord>(`/program/programs/${id}`);
            void logResponse("get_program", { id }, record);
            return formatShow(record, "program program");
          } catch (error) {
            return formatError(error);
          }
        },
      );
    
      server.registerTool(
        "create_program",
        {
          description: "Create a program",
          annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: false },
          inputSchema: {
            name: z.string().describe("Name of the program."),
            category_id: z.number().int().describe("Identifier of the category of the program."),
            cost_scheme: programProgramCostSchemeEnum.describe("How should the program be paid by default."),
            cost: z
              .number()
              .int()
              .optional()
              .describe(
                "The price to be paid for this program. Required if cost_scheme is student (default value) or order.",
              ),
            is_published: z.boolean().optional().describe("Boolean representing the publishable status of the program."),
            label_ids: z.array(z.number().int()).optional().describe("IDs of the labels"),
            custom: z.record(z.unknown()).optional(),
            custom_associations: z.record(z.unknown()).optional(),
            course_tab_contents_attributes: z
              .array(
                z.object({
                  content: z.string().describe("The HTML content of the course tab."),
                  course_tab_id: z.number().int().describe("Unique identifier of the course tab."),
                }),
              )
              .optional(),
          },
        },
        async (body) => {
          try {
            const record = await apiPost<EduframeRecord>("/program/programs", body);
            void logResponse("create_program", body, record);
            return formatCreate(record, "program program");
          } catch (error) {
            return formatError(error);
          }
        },
      );
    
      server.registerTool(
        "update_program",
        {
          description: "Update a program",
          annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: true },
          inputSchema: {
            id: z.number().int().positive().describe("ID of the program program to update"),
            name: z.string().optional().describe("Name of the program."),
            cost: z.string().optional().describe("The price to be paid for this program."),
            cost_scheme: programProgramCostSchemeEnum.optional().describe("How should the program be paid by default."),
            is_published: z.boolean().optional().describe("Boolean representing the publishable status of the program."),
            category_id: z.number().int().optional().describe("Identifier of the category of the program."),
            slug: z.string().optional().describe("Human readable identifier, unique per educator."),
            label_ids: z.array(z.number().int()).optional().describe("IDs of the labels"),
            custom: z.record(z.unknown()).optional(),
            custom_associations: z.record(z.unknown()).optional(),
            course_tab_contents_attributes: z
              .array(
                z.object({
                  content: z.string().describe("The HTML content of the course tab."),
                  course_tab_id: z.number().int().describe("Unique identifier of the course tab."),
                }),
              )
              .optional(),
          },
        },
        async ({ id, ...body }) => {
          try {
            const record = await apiPatch<EduframeRecord>(`/program/programs/${id}`, body);
            void logResponse("update_program", { id, ...body }, record);
            return formatUpdate(record, "program program");
          } catch (error) {
            return formatError(error);
          }
        },
      );
    
      server.registerTool(
        "delete_program",
        {
          description: "Delete a program",
          annotations: { readOnlyHint: false, destructiveHint: true, idempotentHint: true },
          inputSchema: { id: z.number().int().positive().describe("ID of the program program to delete") },
        },
        async ({ id }) => {
          try {
            const record = await apiDelete<EduframeRecord>(`/program/programs/${id}`);
            void logResponse("delete_program", { id }, record);
            return formatDelete(record, "program program");
          } catch (error) {
            return formatError(error);
          }
        },
      );
    }
  • Import of registerProgramProgramTools from program_programs.ts into the central tools index.
    import { registerProgramProgramTools } from "./program_programs";
  • registerProgramProgramTools is included in the registry array, called by registerAllTools() to activate the 'create_program' tool on the MCP server.
    registerProgramProgramTools,
Behavior2/5

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

Annotations already indicate a write operation (readOnlyHint=false), but description adds no behavioral details beyond that. No mention of side effects, constraints, or uniqueness requirements.

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?

Very concise (one sentence), but at the expense of completeness. Every word is necessary, but more detail would be beneficial.

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?

For a complex tool with 9 parameters and nested objects, the description is far too sparse. Lacks context about return values (no output schema) and how parameters interact.

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 67% of parameters with descriptions; description adds no additional meaning. The baseline of 3 is appropriate since schema handles semantics reasonably.

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

Purpose3/5

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

Description ('Create a program') states a verb and resource, but is too generic. It does not distinguish what a 'program' is from sibling tools like create_course or create_program_edition.

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. Lacks context about prerequisites or when a program should be created over other similar entities.

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