Skip to main content
Glama

update_grade

Idempotent

Update a grade record by providing its ID and optionally changing the grade, score, comment, or associated enrollment.

Instructions

Update a grade

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesID of the grade to update
gradeNoThe grade awarded (at least one of grade and score is required)
scoreNoThe score awarded (at least one of grade and score is required)
gradeable_idNoUnique model identifier of the gradeable (enrollment / ...)
gradeable_typeNoModel type of the gradeable (enrollment / ...)
commentNoAdditional comment about the grade
enrollment_idNoUnique identifier of the enrollment

Implementation Reference

  • Handler function for update_grade tool. Destructures id from body, calls apiPatch to PATCH /grades/{id}, logs the response, and returns formatted update result.
    async ({ id, ...body }) => {
      try {
        const record = await apiPatch<EduframeRecord>(`/grades/${id}`, body);
        void logResponse("update_grade", { id, ...body }, record);
        return formatUpdate(record, "grade");
      } catch (error) {
        return formatError(error);
      }
    },
  • Input schema for update_grade tool: requires id (positive int), with optional grade, score, gradeable_id, gradeable_type, comment, and enrollment_id fields.
    inputSchema: {
      id: z.number().int().positive().describe("ID of the grade to update"),
      grade: z.string().optional().describe("The grade awarded (at least one of grade and score is required)"),
      score: z.number().optional().describe("The score awarded (at least one of grade and score is required)"),
      gradeable_id: z
        .number()
        .int()
        .optional()
        .describe("Unique model identifier of the gradeable (enrollment / ...)"),
      gradeable_type: z.string().optional().describe("Model type of the gradeable (enrollment / ...)"),
      comment: z.string().optional().describe("Additional comment about the grade"),
      enrollment_id: z.number().int().optional().describe("Unique identifier of the enrollment"),
    },
  • Registration of update_grade tool via server.registerTool, with description, annotations, schema, and handler callback.
    server.registerTool(
      "update_grade",
      {
        description: "Update a grade",
        annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: true },
        inputSchema: {
          id: z.number().int().positive().describe("ID of the grade to update"),
          grade: z.string().optional().describe("The grade awarded (at least one of grade and score is required)"),
          score: z.number().optional().describe("The score awarded (at least one of grade and score is required)"),
          gradeable_id: z
            .number()
            .int()
            .optional()
            .describe("Unique model identifier of the gradeable (enrollment / ...)"),
          gradeable_type: z.string().optional().describe("Model type of the gradeable (enrollment / ...)"),
          comment: z.string().optional().describe("Additional comment about the grade"),
          enrollment_id: z.number().int().optional().describe("Unique identifier of the enrollment"),
        },
      },
      async ({ id, ...body }) => {
        try {
          const record = await apiPatch<EduframeRecord>(`/grades/${id}`, body);
          void logResponse("update_grade", { id, ...body }, record);
          return formatUpdate(record, "grade");
        } catch (error) {
          return formatError(error);
        }
      },
  • registerAllTools iterates over all tool registration functions (including registerGradeTools) and calls them with the server instance.
    export function registerAllTools(server: McpServer): void {
      for (const register of tools) {
        register(server);
      }
    }
  • apiPatch helper used by update_grade handler to send a PATCH request with JSON body to the Eduframe API.
    export async function apiPatch<T>(path: string, body: unknown): Promise<T> {
      const { token } = getConfig();
      const url = buildUrl(path);
    
      const response = await fetch(url.toString(), {
        method: "PATCH",
        headers: buildHeaders(token),
        body: JSON.stringify(body),
      });
    
      return handleResponse<T>(response);
    }
Behavior2/5

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

Description adds no behavioral context beyond annotations. Annotations indicate readOnlyHint=false (modifying) and idempotentHint=true, but description does not describe partial update behavior or side effects.

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 with no wasted words, but it is overly terse and lacks structure beyond the verb.

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, 7 parameters, but description does not explain update semantics (e.g., partial updates, required constraints). Insufficient for an agent to understand behavior.

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 parameter descriptions, so baseline 3. Description does not add extra meaning beyond what the schema provides.

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 'Update a grade' with a specific verb and resource, distinguishing it from create_grade and delete_grade. However, it does not elaborate on scope or nuances.

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 like create_grade or other update tools. 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