Skip to main content
Glama

coda_list_pages

Retrieve and paginate through pages in a Coda document by specifying the document ID, limiting the number of pages returned, and using a token for subsequent results.

Instructions

List pages in the current document with pagination

Input Schema

NameRequiredDescriptionDefault
docIdYesThe ID of the document to list pages from
limitNoThe number of pages to return - optional, defaults to 25
nextPageTokenNoThe token need to get the next page of results, returned from a previous call to this tool - optional

Input Schema (JSON Schema)

{ "$schema": "http://json-schema.org/draft-07/schema#", "additionalProperties": false, "properties": { "docId": { "description": "The ID of the document to list pages from", "type": "string" }, "limit": { "description": "The number of pages to return - optional, defaults to 25", "exclusiveMinimum": 0, "type": "integer" }, "nextPageToken": { "description": "The token need to get the next page of results, returned from a previous call to this tool - optional", "type": "string" } }, "required": [ "docId" ], "type": "object" }

Implementation Reference

  • Handler function that implements the core logic of the coda_list_pages tool by invoking the listPages SDK function with pagination support and handling errors.
    async ({ docId, limit, nextPageToken }): Promise<CallToolResult> => { try { const listLimit = nextPageToken ? undefined : limit; const resp = await listPages({ path: { docId }, query: { limit: listLimit, pageToken: nextPageToken ?? undefined }, throwOnError: true, }); return { content: [{ type: "text", text: JSON.stringify(resp.data) }], }; } catch (error) { return { content: [{ type: "text", text: `Failed to list pages: ${error}` }], isError: true, }; } },
  • Zod schema defining the input parameters for the coda_list_pages tool: docId (required string), limit (optional positive integer), nextPageToken (optional string).
    docId: z.string().describe("The ID of the document to list pages from"), limit: z.number().int().positive().optional().describe("The number of pages to return - optional, defaults to 25"), nextPageToken: z .string() .optional() .describe( "The token need to get the next page of results, returned from a previous call to this tool - optional", ), },
  • src/server.ts:34-67 (registration)
    Full registration of the coda_list_pages tool with the McpServer instance, specifying name, description, input schema, and inline handler function.
    server.tool( "coda_list_pages", "List pages in the current document with pagination", { docId: z.string().describe("The ID of the document to list pages from"), limit: z.number().int().positive().optional().describe("The number of pages to return - optional, defaults to 25"), nextPageToken: z .string() .optional() .describe( "The token need to get the next page of results, returned from a previous call to this tool - optional", ), }, async ({ docId, limit, nextPageToken }): Promise<CallToolResult> => { try { const listLimit = nextPageToken ? undefined : limit; const resp = await listPages({ path: { docId }, query: { limit: listLimit, pageToken: nextPageToken ?? undefined }, throwOnError: true, }); return { content: [{ type: "text", text: JSON.stringify(resp.data) }], }; } catch (error) { return { content: [{ type: "text", text: `Failed to list pages: ${error}` }], isError: true, }; } }, );

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/orellazri/coda-mcp'

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