get_rights
Retrieve rights and licensing information for media assets to verify provenance and license terms, including C2PA credentials, structured data, and metadata.
Instructions
Get rights and licensing information for a registered media asset. Returns C2PA content credentials, Schema.org structured data, IPTC rights metadata, and TDM-AI protocol declarations. Useful for verifying provenance and license terms.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| media_id | Yes | UUID of the media asset |
Implementation Reference
- src/tools/get-rights.ts:5-37 (handler)Complete handler implementation for the get_rights tool. Defines the tool name 'get_rights', description, input schema (media_id parameter), and the async handler logic that makes an API call to /api/v1/rights/{media_id} and returns the response with error handling.
export function register(server: McpServer, api: ApiClient): void { server.tool( "get_rights", "Get rights and licensing information for a registered media asset. " + "Returns C2PA content credentials, Schema.org structured data, IPTC rights metadata, " + "and TDM-AI protocol declarations. Useful for verifying provenance and license terms.", { media_id: z.string().describe("UUID of the media asset"), }, async ({ media_id }) => { try { const result = await api.get( `/api/v1/rights/${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-rights.ts:11-13 (schema)Input validation schema using Zod. Defines the required media_id parameter as a string, described as 'UUID of the media asset'.
{ media_id: z.string().describe("UUID of the media asset"), }, - src/index.ts:20-20 (registration)Import statement for the get_rights tool register function from ./tools/get-rights.js
import { register as getRights } from "./tools/get-rights.js"; - src/index.ts:66-66 (registration)Registration call that activates the get_rights tool by calling getRights(server, api) in the 'Rights & billing' section
getRights(server, api);