Skip to main content
Glama

get_collection_items

Retrieve items from a collection with pagination, sorting, filtering, and relation population.

Instructions

Liste les items d'une collection avec pagination, tri, filtres et populate

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
collectionYesNom de la collection
pageNoNuméro de page (défaut: 1)
perPageNoItems par page (défaut: 20, max: 100)
sortNoChamp de tri. Préfixe - pour descendant (ex: -created_at)
populateNoRelations à inclure, séparées par des virgules (ex: author,category)
filtersNoFiltres JSON (ex: { status: 'active' })

Implementation Reference

  • Handler case in the MCP request dispatcher that extracts arguments (collection, page, perPage, sort, populate, filters) and delegates to skema.getItems()
    case "get_collection_items": {
      const { collection, page, perPage, sort, populate, filters } = args as {
        collection: string;
        page?: number;
        perPage?: number;
        sort?: string;
        populate?: string;
        filters?: Record<string, unknown>;
      };
      result = await skema.getItems(collection, {
        page,
        perPage,
        sort,
        populate,
        filters,
      });
      break;
    }
  • Helper function that calls the remote MCP API via JSON-RPC with the 'get_collection_items' tool name
    export const getItems = (
      collection: string,
      options?: {
        page?: number;
        perPage?: number;
        sort?: string;
        populate?: string;
        filters?: Record<string, unknown>;
      }
    ) =>
      mcpCall("get_collection_items", {
        collection,
        page: options?.page,
        perPage: options?.perPage,
        sort: options?.sort,
        populate: options?.populate,
        filters: options?.filters,
      });
  • Tool registration with inputSchema defining the parameters: collection (required), page, perPage, sort, populate, filters (optional)
      name: "get_collection_items",
      description: "Liste les items d'une collection avec pagination, tri, filtres et populate",
      inputSchema: {
        type: "object",
        properties: {
          collection: {
            type: "string",
            description: "Nom de la collection",
          },
          page: {
            type: "number",
            description: "Numéro de page (défaut: 1)",
          },
          perPage: {
            type: "number",
            description: "Items par page (défaut: 20, max: 100)",
          },
          sort: {
            type: "string",
            description: "Champ de tri. Préfixe - pour descendant (ex: -created_at)",
          },
          populate: {
            type: "string",
            description: "Relations à inclure, séparées par des virgules (ex: author,category)",
          },
          filters: {
            type: "object",
            description: "Filtres JSON (ex: { status: 'active' })",
          },
        },
        required: ["collection"],
      },
    },
  • src/tools.ts:32-33 (registration)
    Registration of the 'get_collection_items' tool in the tools array used by ListToolsRequestHandler
    {
      name: "get_collection_items",
Behavior3/5

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

With no annotations, the description must disclose behaviors. It mentions pagination, sorting, filters, and populate, which are key traits. However, it lacks details on authorization, error behavior, rate limits, or what happens with invalid input. The disclosure is adequate but not comprehensive.

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 a single concise sentence that captures the core functionality. It is efficiently front-loaded with key features. While a bit more structure (e.g., separating features) could improve clarity, it wastes no words.

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

Completeness2/5

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

The tool has moderate complexity with 6 parameters and no output schema or annotations. The description is minimal and does not cover return format, error handling, or usage examples. It leaves the agent with significant unknowns for effective invocation.

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 coverage is 100%, so the baseline is 3. The description echoes the parameter purposes ('pagination, tri, filtres et populate') but adds no new meaning beyond the schema. It does not explain the format of filters or sort strings beyond what the schema provides.

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 tool lists items of a collection with pagination, sorting, filters, and populate. It uses a specific verb ('Liste') and resource ('items d'une collection'), and distinguishes itself from sibling tools like 'search_collection_items' (search) and 'get_collection_item' (single item). This is a precise and differentiated purpose.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives. It does not mention when not to use it, nor does it compare with sibling tools like batch or search operations. The agent receives no context for selection.

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

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