Skip to main content
Glama

list_media

Retrieve a paginated list of your media assets with IDs, types, status, tags, and protection details for managing digital content.

Instructions

List media assets registered to your account. Returns a paginated list with media IDs, types, status, tags, and protection details. Use cursor-based pagination for large libraries.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
cursorNoPagination cursor from a previous response
limitNoResults per page (1-100, default: 20)

Implementation Reference

  • Main implementation of list_media tool - contains the register function that defines the tool schema (cursor, limit parameters) and the handler logic that makes an API call to /api/v1/media and returns paginated media assets list
    export function register(server: McpServer, api: ApiClient): void {
      server.tool(
        "list_media",
        "List media assets registered to your account. Returns a paginated list " +
          "with media IDs, types, status, tags, and protection details. " +
          "Use cursor-based pagination for large libraries.",
        {
          cursor: z
            .string()
            .optional()
            .describe("Pagination cursor from a previous response"),
          limit: z
            .number()
            .int()
            .min(1)
            .max(100)
            .optional()
            .describe("Results per page (1-100, default: 20)"),
        },
        async (params) => {
          try {
            const result = await api.get("/api/v1/media", {
              cursor: params.cursor,
              limit: params.limit?.toString(),
            });
            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,
            };
          }
        },
      );
    }
  • Schema definition for list_media tool parameters using Zod - defines optional cursor for pagination and limit parameter (1-100, default 20)
    {
      cursor: z
        .string()
        .optional()
        .describe("Pagination cursor from a previous response"),
      limit: z
        .number()
        .int()
        .min(1)
        .max(100)
        .optional()
        .describe("Results per page (1-100, default: 20)"),
    },
  • src/index.ts:16-16 (registration)
    Import statement for list_media registration function
    import { register as listMedia } from "./tools/list-media.js";
  • src/index.ts:60-60 (registration)
    Registration call for list_media tool in the main application setup
    listMedia(server, api);
Behavior4/5

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

With no annotations provided, the description carries full burden and does well by disclosing key behavioral traits: it returns a paginated list with specific fields (media IDs, types, status, tags, protection details) and uses cursor-based pagination. However, it doesn't mention rate limits, authentication requirements, or error conditions.

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 perfectly concise with two sentences that each earn their place: the first states the core purpose and return format, the second explains pagination behavior. No wasted words, well-structured and front-loaded.

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

Completeness4/5

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

Given no annotations and no output schema, the description provides good context about what the tool returns (paginated list with specific fields) and its pagination behavior. For a list operation with 2 parameters, this is reasonably complete, though it could mention authentication or error handling.

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?

Schema description coverage is 100%, so the schema already fully documents both parameters (cursor for pagination, limit for results per page). The description adds no additional parameter semantics beyond what's in the schema, maintaining the baseline score of 3.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb ('List') and resource ('media assets registered to your account'), making the purpose specific and understandable. However, it doesn't explicitly differentiate from sibling tools like 'search_media' or 'get_media', which would require more specific scope clarification.

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 for retrieving media assets with pagination for large libraries, but doesn't explicitly state when to use this tool versus alternatives like 'search_media' (for filtered searches) or 'get_media' (for single media retrieval). No explicit exclusions or prerequisites are mentioned.

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