Skip to main content
Glama

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
NameRequiredDescriptionDefault
media_idYesUUID of the media asset

Implementation Reference

  • 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,
        };
      }
    },
  • 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,
            };
          }
        },
      );
    }
  • 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);
Behavior3/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It indicates this is a read operation ('Get details') and lists the types of information returned (metadata, protection status, etc.), which adds useful context. However, it does not cover aspects like error handling, authentication needs, or rate limits, leaving gaps in behavioral understanding.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, well-structured sentence that efficiently conveys the tool's purpose and return values without any redundant information. It is front-loaded with the core action and resource, making it easy to parse quickly.

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

Completeness3/5

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

Given the tool's moderate complexity (single parameter, read-only operation) and lack of annotations or output schema, the description is adequate but incomplete. It specifies what information is returned but not the format or structure, which could hinder an agent's ability to interpret results effectively.

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?

The input schema has 100% description coverage, with the single parameter 'media_id' documented as a 'UUID of the media asset'. The description adds no additional parameter semantics beyond what the schema provides, such as format examples or constraints, so it meets the baseline for high schema coverage.

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 clearly states the verb ('Get details') and resource ('specific registered media asset by ID'), distinguishing it from sibling tools like list_media (which lists multiple assets) and delete_media (which removes assets). It specifies the exact scope of retrieval, making the purpose unambiguous.

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

Usage Guidelines3/5

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

The description implies usage when details for a specific media asset are needed, but it does not explicitly state when to use this tool versus alternatives like list_media (for browsing) or search_media (for querying). No exclusions or prerequisites are mentioned, leaving some ambiguity in context.

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/sidearmDRM/mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server