Skip to main content
Glama
elmapicms

elmapicms-mcp-server

Official
by elmapicms

List Entries

list_entries

Fetch content entries from a collection using filters, sorting, and pagination. Apply complex queries with the 'where' parameter.

Instructions

List content entries for a collection with advanced filtering, sorting, and pagination. Use the 'where' parameter for powerful queries. Read the 'query-reference' resource for full documentation on operators and examples.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
collection_slugYesThe collection slug
whereNoFilter conditions as a nested object. Supports operators: eq, lt, lte, gt, gte, not, like, in, not_in, null, not_null, between, not_between. Simple: { "status": "published" }. With operators: { "price": { "lt": 50 }, "title": { "like": "news" } }. OR group: { "or": [{ "tags": "clearance" }, { "campaign": { "name": "Summer" } }] }. Relation filter: { "author": { "name": { "eq": "John" } } }. Core columns (id, uuid, locale, status, created_at, updated_at, published_at) can be filtered directly.
localeNoFilter by locale (e.g. 'en')
stateNoFilter by state: 'only_draft' or 'with_draft'. Defaults to published entries only.
sortNoSort by field:direction, comma-separated for multiple. Examples: 'created_at:desc', 'title:asc,created_at:desc'. Supports core columns (id, created_at, updated_at, published_at) and custom field names.
paginateNoEnable pagination with N items per page. Returns paginated response with meta data. Overrides limit/offset.
limitNoLimit the number of results (ignored if paginate is set)
offsetNoSkip N results (requires limit to be set)
firstNoIf true, return only the first matching entry as a single object instead of an array
countNoIf true, return only the count of matching entries: { count: N }
excludeNoComma-separated field names to exclude from response (e.g. 'content,excerpt')

Implementation Reference

  • The async handler function for the 'list_entries' tool. It accepts the input parameters, constructs query params, makes a GET request via the client, and returns the JSON result.
    }, async ({ collection_slug, where, locale, state, sort, paginate, limit, offset, first, count, exclude }) => {
      const params: Record<string, unknown> = {};
      if (locale) params.locale = locale;
      if (state) params.state = state;
      if (sort) params.sort = sort;
      if (paginate) params.paginate = paginate;
      if (limit) params.limit = limit;
      if (offset) params.offset = offset;
      if (first) params.first = 1;
      if (count) params.count = 1;
      if (exclude) params.exclude = exclude;
    
      // Pass where as a nested object — the client will flatten to bracket notation
      if (where) {
        params.where = where;
      }
    
      const result = await client.get(`/${collection_slug}`, params);
      return {
        content: [{ type: "text", text: JSON.stringify(result, null, 2) }],
      };
    });
  • The input schema for the 'list_entries' tool, defining parameters: collection_slug, where, locale, state, sort, paginate, limit, offset, first, count, exclude with Zod validators.
    title: "List Entries",
    description:
      "List content entries for a collection with advanced filtering, sorting, and pagination. " +
      "Use the 'where' parameter for powerful queries. Read the 'query-reference' resource for full documentation on operators and examples.",
    inputSchema: {
      collection_slug: z.string().describe("The collection slug"),
      where: z
        .record(z.string(), z.unknown())
        .optional()
        .describe(
          "Filter conditions as a nested object. Supports operators: eq, lt, lte, gt, gte, not, like, in, not_in, null, not_null, between, not_between. " +
          "Simple: { \"status\": \"published\" }. " +
          "With operators: { \"price\": { \"lt\": 50 }, \"title\": { \"like\": \"news\" } }. " +
          "OR group: { \"or\": [{ \"tags\": \"clearance\" }, { \"campaign\": { \"name\": \"Summer\" } }] }. " +
          "Relation filter: { \"author\": { \"name\": { \"eq\": \"John\" } } }. " +
          "Core columns (id, uuid, locale, status, created_at, updated_at, published_at) can be filtered directly."
        ),
      locale: z
        .string()
        .optional()
        .describe("Filter by locale (e.g. 'en')"),
      state: z
        .string()
        .optional()
        .describe("Filter by state: 'only_draft' or 'with_draft'. Defaults to published entries only."),
      sort: z
        .string()
        .optional()
        .describe(
          "Sort by field:direction, comma-separated for multiple. " +
          "Examples: 'created_at:desc', 'title:asc,created_at:desc'. " +
          "Supports core columns (id, created_at, updated_at, published_at) and custom field names."
        ),
      paginate: z
        .number()
        .optional()
        .describe("Enable pagination with N items per page. Returns paginated response with meta data. Overrides limit/offset."),
      limit: z
        .number()
        .optional()
        .describe("Limit the number of results (ignored if paginate is set)"),
      offset: z
        .number()
        .optional()
        .describe("Skip N results (requires limit to be set)"),
      first: z
        .boolean()
        .optional()
        .describe("If true, return only the first matching entry as a single object instead of an array"),
      count: z
        .boolean()
        .optional()
        .describe("If true, return only the count of matching entries: { count: N }"),
      exclude: z
        .string()
        .optional()
        .describe("Comma-separated field names to exclude from response (e.g. 'content,excerpt')"),
    },
  • Registration of the 'list_entries' tool via server.registerTool() within the registerContentTools function.
    server.registerTool("list_entries", {
  • src/index.ts:38-38 (registration)
    Top-level call to registerContentTools(server, client) which registers the 'list_entries' tool.
    registerContentTools(server, client);
  • The client.get() method used by the handler to make the HTTP GET request with flattened query parameters.
    async get(
      path: string,
      params?: Record<string, unknown>
    ): Promise<unknown> {
      const url = new URL(`${this.baseUrl}${path}`);
      if (params) {
        const flatPairs = this.flattenParams(params);
        for (const [key, value] of flatPairs) {
          url.searchParams.append(key, value);
        }
      }
    
      const response = await fetch(url.toString(), {
        method: "GET",
        headers: this.headers(),
      });
    
      return this.handleResponse(response);
    }
Behavior2/5

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

With no annotations, the description carries full burden but only mentions surface features. It does not disclose side effects, idempotency, authentication needs, or performance implications beyond what the schema implies.

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?

Three concise sentences that front-load the main action and direct to detailed docs. No wasted 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?

Given the complexity (11 parameters, nested objects, no output schema), the description is incomplete. It omits return format, pagination meta, error handling, and example usage, leaving the agent to infer from schema alone.

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% with detailed parameter descriptions. The description adds minor value by summarizing filtering/sorting/pagination and referencing external docs, but does not significantly enhance understanding beyond the schema.

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 'content entries for a collection', distinguishing it from sibling tools like get_entry (single) or create_entry. However, it does not explicitly contrast with alternatives.

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 mentions using the 'where' parameter but provides no guidance on when to use this tool vs. others (e.g., get_entry for single entries) or prerequisites. No exclusions or 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/elmapicms/elmapicms-mcp-server'

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