Skip to main content
Glama

manage_media

Create, update, delete, and retrieve media files in Gramps, including uploads, thumbnails, OCR, and face detection.

Instructions

Manage Gramps Media objects and their files. Writes: create, update, delete, upload.

Standard CRUD via /media/ plus binary operations: get/create/update/delete -> as in manage_person (GET/POST/PUT/DELETE). upload -> POST /media/ streaming file_path bytes with mime_type (required); the API computes the checksum and creates the Media row. file -> GET /media//file; returns base64 bytes. thumbnail -> GET /media//thumbnail/; returns base64 image; pass {"square": true} in query. ocr -> GET /media//ocr; returns OCR text. face_detection -> GET /media//face_detection; returns detected/test faces (see upstream for params). Repeat action for repeated sub-actions; 'create' accepts a Media JSON body in data (needs an already-uploaded file), while 'upload' bulk-loads a local file. Consider merge_objects for duplicate media.

Args: action: "get", "create", "update", "delete", "upload", "file", "thumbnail", "ocr" or "face_detection". handle: Media handle; required for get-one, update, delete, file, thumbnail, ocr, face_detection. data: The Media object for create/update (required for those). query: Optional dict of extra query-string parameters (e.g. {"square": true}). file_path: Local file path for the 'upload' action (required there). mime_type: MIME type of the upload (e.g. 'image/jpeg'); required for 'upload'. size: Thumbnail target size in pixels (required for 'thumbnail'). instance: Gramps Web base URL from get_instances; default = first.

Returns: dict: {"status", "url", "data"} where binary results carry base64/mimetype.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
dataNo
sizeNo
queryNo
actionYes
handleNo
instanceNo
file_pathNo
mime_typeNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.5/5.0
Behavior4/5

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

With no annotations, the description carries the behavioral burden and covers a lot: upload streams file_path and computes checksum/creates the Media row, binary endpoints return base64, and the return shape is documented. It falls slightly short by not addressing auth/permission needs or reversibility, and face_detection parameters are deferred to upstream.

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?

The description is long but well organized: summary, operation bullets, Args, and Returns. It front-loads the core purpose and action list; there is minor redundancy between the operation bullets and the Args section, but it remains scannable and purposeful.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity—8 parameters, 9 actions, no output schema, and no annotations—the description covers action semantics, endpoint patterns, required-parameter relationships, and the return envelope. An agent has enough information to select and invoke this tool correctly for each listed action.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, but the Args section documents all 8 parameters, including valid action values, which actions require handle/data/file_path/mime_type/size, and the default behavior for instance. This fully compensates for the empty schema descriptions.

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 opens with a specific verb and resource: 'Manage Gramps Media objects and their files.' It enumerates the full action set (get/create/update/delete/upload/file/thumbnail/ocr/face_detection) and distinguishes itself from siblings by referencing manage_person for the CRUD pattern and merge_objects for duplicates.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description gives per-action usage semantics and required parameters, and explicitly recommends merge_objects for duplicate media. It does not explicitly enumerate when not to use each sibling manage_* tool, but the resource-specific focus and sibling names make the intended use clear.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.