get_media
Retrieve comprehensive metadata for a registered media asset, including protection status, applied algorithms, tags, and storage details using its unique identifier.
Instructions
Get details of a specific registered media asset by ID. Returns metadata, protection status, applied algorithms, tags, and storage information.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| media_id | Yes | UUID of the media asset |
Implementation Reference
- src/tools/get-media.ts:13-34 (handler)The main handler function that executes the get_media tool. It takes media_id as input, makes a GET request to /api/v1/media/{media_id}, and returns the media details as formatted JSON or handles errors gracefully.
async ({ media_id }) => { try { const result = await api.get( `/api/v1/media/${encodeURIComponent(media_id)}`, ); return { content: [ { type: "text" as const, text: JSON.stringify(result, null, 2) }, ], }; } catch (err) { return { content: [ { type: "text" as const, text: `Error: ${err instanceof Error ? err.message : String(err)}`, }, ], isError: true as const, }; } }, - src/tools/get-media.ts:5-36 (registration)The registration function that registers the get_media tool with the MCP server, including the tool name, description, schema definition, and handler function.
export function register(server: McpServer, api: ApiClient): void { server.tool( "get_media", "Get details of a specific registered media asset by ID. Returns metadata, " + "protection status, applied algorithms, tags, and storage information.", { media_id: z.string().describe("UUID of the media asset"), }, async ({ media_id }) => { try { const result = await api.get( `/api/v1/media/${encodeURIComponent(media_id)}`, ); return { content: [ { type: "text" as const, text: JSON.stringify(result, null, 2) }, ], }; } catch (err) { return { content: [ { type: "text" as const, text: `Error: ${err instanceof Error ? err.message : String(err)}`, }, ], isError: true as const, }; } }, ); } - src/tools/get-media.ts:10-12 (schema)The Zod schema definition for the get_media tool input parameters, defining media_id as a required string with UUID description.
{ media_id: z.string().describe("UUID of the media asset"), }, - src/index.ts:17-17 (registration)Import statement for the get_media tool registration function from ./tools/get-media.js
import { register as getMedia } from "./tools/get-media.js"; - src/index.ts:61-61 (registration)Registration call that activates the get_media tool in the MCP server with the API client instance
getMedia(server, api);