Skip to content

Update exercise

Use this to apply a field-level patch to one exercise with an updated_at precondition and shared-usage acknowledgement.

{
"annotations": {
"readOnlyHint": false,
"destructiveHint": false,
"idempotentHint": false,
"openWorldHint": false
},
"fileParams": [],
"requiredPermission": "write",
"security": {
"type": "oauth2",
"scopes": [
"chalksurf:write"
]
}
}

The server advertises this JSON Schema to MCP clients. Runtime authorization and business-rule checks still apply.

{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"additionalProperties": false,
"properties": {
"allowSharedExerciseUpdate": {
"default": false,
"type": "boolean"
},
"expectedUpdatedAt": {
"minLength": 1,
"type": "string"
},
"id": {
"format": "uuid",
"pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
"type": "string"
},
"organizationId": {
"description": "The ChalkSurf organization ID to use for this request.",
"format": "uuid",
"pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
"type": "string"
},
"patch": {
"additionalProperties": false,
"properties": {
"difficulty": {
"anyOf": [
{
"maximum": 100,
"minimum": 1,
"type": "number"
},
{
"type": "null"
}
]
},
"labels": {
"items": {
"type": "string"
},
"type": "array"
},
"max_age": {
"anyOf": [
{
"maximum": 100,
"minimum": 0,
"type": "number"
},
{
"type": "null"
}
]
},
"metadata": {
"additionalProperties": false,
"properties": {
"solutionUrl": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
]
},
"sourceUrl": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
]
}
},
"type": "object"
},
"min_age": {
"anyOf": [
{
"maximum": 100,
"minimum": 0,
"type": "number"
},
{
"type": "null"
}
]
},
"private_notes": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
]
},
"source": {
"anyOf": [
{
"minLength": 1,
"type": "string"
},
{
"type": "null"
}
]
},
"subject": {
"enum": [
"math",
"physics",
"chemistry"
],
"type": "string"
},
"translations": {
"additionalProperties": {
"additionalProperties": false,
"properties": {
"answer": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
]
},
"description": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
]
},
"detailed_solution": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
]
},
"exercise_text": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
]
},
"hint": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
]
},
"scaffold": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
]
}
},
"type": "object"
},
"properties": {},
"type": "object"
}
},
"type": "object"
},
"targetSheetId": {
"anyOf": [
{
"format": "uuid",
"pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
"type": "string"
},
{
"type": "null"
}
]
}
},
"required": [
"id",
"expectedUpdatedAt",
"patch",
"organizationId"
],
"type": "object"
}
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"additionalProperties": false,
"properties": {
"error": {
"additionalProperties": false,
"properties": {
"agentErrorDetails": {
"oneOf": [
{
"additionalProperties": false,
"properties": {
"results": {
"items": {
"additionalProperties": false,
"properties": {
"field": {
"enum": [
"exercise_text",
"description",
"hint",
"answer",
"scaffold",
"detailed_solution"
],
"type": "string"
},
"language": {
"minLength": 1,
"type": "string"
},
"patchPath": {
"minLength": 1,
"type": "string"
},
"path": {
"minLength": 1,
"type": "string"
},
"validation": {
"additionalProperties": false,
"properties": {
"issues": {
"items": {
"additionalProperties": false,
"properties": {
"code": {
"enum": [
"unclosed_delimiter",
"blacklisted_command",
"disallowed_control_character_in_math",
"disallowed_control_character_in_text",
"double_escaped_latex_command",
"katex_parse_error",
"raw_latex_command_outside_math"
],
"type": "string"
},
"end": {
"maximum": 9007199254740991,
"minimum": 0,
"type": "integer"
},
"hint": {
"type": "string"
},
"message": {
"type": "string"
},
"severity": {
"const": "error",
"type": "string"
},
"snippet": {
"type": "string"
},
"start": {
"maximum": 9007199254740991,
"minimum": 0,
"type": "integer"
}
},
"required": [
"code",
"message",
"severity",
"snippet",
"start",
"end"
],
"type": "object"
},
"type": "array"
},
"path": {
"type": "string"
},
"valid": {
"type": "boolean"
},
"value": {
"type": "string"
}
},
"required": [
"path",
"value",
"valid",
"issues"
],
"type": "object"
}
},
"required": [
"language",
"field",
"path",
"patchPath",
"validation"
],
"type": "object"
},
"type": "array"
},
"summary": {
"additionalProperties": false,
"properties": {
"affectedPathCount": {
"maximum": 9007199254740991,
"minimum": 0,
"type": "integer"
},
"checkedSnippetCount": {
"maximum": 9007199254740991,
"minimum": 0,
"type": "integer"
},
"invalidSnippetCount": {
"maximum": 9007199254740991,
"minimum": 0,
"type": "integer"
}
},
"required": [
"checkedSnippetCount",
"invalidSnippetCount",
"affectedPathCount"
],
"type": "object"
},
"type": {
"const": "invalid_latex",
"type": "string"
}
},
"required": [
"type",
"summary",
"results"
],
"type": "object"
}
]
},
"code": {
"enum": [
"validation_error",
"unauthorized",
"forbidden",
"not_found",
"timeout",
"import_source_error",
"precondition_failed",
"confirmation_required",
"resource_in_use",
"feature_disabled",
"figure_quality_failed",
"figure_render_failed",
"image_transform_failed",
"invalid_label",
"invalid_latex",
"storage_upload_failed",
"unsupported_image",
"validation_failed",
"organization_selection_required",
"organization_access_denied",
"internal_error"
],
"type": "string"
},
"message": {
"minLength": 1,
"type": "string"
}
},
"required": [
"code",
"message"
],
"type": "object"
},
"isError": {
"const": true,
"type": "boolean"
},
"receipt": {
"additionalProperties": false,
"properties": {
"changedPaths": {
"items": {
"type": "string"
},
"type": "array"
},
"details": {},
"operation": {
"enum": [
"copy_exercise",
"copy_sheet",
"update_exercise",
"resolve_quality_issue",
"dismiss_quality_issue",
"update_sheet",
"bulk_update_sheets",
"append_exercises_to_sheet",
"create_folder",
"rename_folder",
"delete_exercise",
"delete_sheet",
"delete_folder",
"create_sheet",
"create_exercise",
"upload_exercise_figure",
"set_exercise_visibility",
"set_sheet_visibility"
],
"type": "string"
},
"precondition": {
"additionalProperties": false,
"properties": {
"actualUpdatedAt": {
"anyOf": [
{
"minLength": 1,
"type": "string"
},
{
"type": "null"
}
]
},
"expectedUpdatedAt": {
"anyOf": [
{
"minLength": 1,
"type": "string"
},
{
"type": "null"
}
]
},
"status": {
"enum": [
"matched",
"not_required"
],
"type": "string"
}
},
"required": [
"status"
],
"type": "object"
},
"resource": {
"additionalProperties": false,
"properties": {
"id": {
"format": "uuid",
"pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
"type": "string"
},
"type": {
"enum": [
"exercise",
"sheet",
"folder"
],
"type": "string"
}
},
"required": [
"type",
"id"
],
"type": "object"
},
"version": {
"oneOf": [
{
"additionalProperties": false,
"properties": {
"created": {
"const": true,
"type": "boolean"
},
"resourceType": {
"const": "sheet",
"type": "string"
},
"versionId": {
"format": "uuid",
"pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
"type": "string"
},
"versionNumber": {
"exclusiveMinimum": 0,
"maximum": 9007199254740991,
"type": "integer"
}
},
"required": [
"resourceType",
"created",
"versionId",
"versionNumber"
],
"type": "object"
},
{
"additionalProperties": false,
"properties": {
"created": {
"const": false,
"type": "boolean"
},
"reason": {
"minLength": 1,
"type": "string"
},
"resourceType": {
"const": "sheet",
"type": "string"
}
},
"required": [
"resourceType",
"created",
"reason"
],
"type": "object"
}
]
},
"warnings": {
"items": {
"additionalProperties": false,
"properties": {
"code": {
"type": "string"
},
"details": {},
"message": {
"type": "string"
}
},
"required": [
"code",
"message"
],
"type": "object"
},
"type": "array"
}
},
"required": [
"resource",
"operation",
"changedPaths",
"precondition",
"warnings",
"details"
],
"type": "object"
}
},
"type": "object"
}