Skip to main content
Glama

get_doc_pages

Retrieve pages from a ClickUp doc in markdown or plain text. Provide the doc and workspace IDs to get the content.

Instructions

Get the pages of a specific ClickUp doc. Returns page content in the requested format (markdown or plain text).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
doc_idYesThe ID of the doc to get pages from
workspace_idYesThe ID of the workspace containing the doc
content_formatNoThe format to return the content in

Implementation Reference

  • The get_doc_pages tool handler - calls docsClient.getDocPages() and returns JSON-stringified pages array.
    // Register get_doc_pages tool
    server.tool(
      'get_doc_pages',
      'Get the pages of a specific ClickUp doc. Returns page content in the requested format (markdown or plain text).',
      {
        doc_id: z.string().describe('The ID of the doc to get pages from'),
        workspace_id: z.string().describe('The ID of the workspace containing the doc'),
        content_format: z.enum(['text/md', 'text/plain']).optional().describe('The format to return the content in')
      },
      async ({ doc_id, workspace_id, content_format }) => {
        try {
          // Get the pages of the doc
          const pages = await docsClient.getDocPages(workspace_id, doc_id, content_format);
          
          return {
            content: [{ type: 'text', text: JSON.stringify(pages, null, 2) }]
          };
        } catch (error: any) {
          console.error('Error getting doc pages:', error);
          return {
            content: [{ type: 'text', text: `Error getting doc pages: ${error.message}` }],
            isError: true
          };
        }
      }
    );
  • src/index.ts:40-47 (registration)
    setupDocTools is called from the main server's setupTools() to register all doc tools including get_doc_pages.
    private setupTools() {
      // Set up all tools
      setupTaskTools(this.server);
      setupDocTools(this.server);
      setupSpaceTools(this.server);
      setupChecklistTools(this.server);
      setupCommentTools(this.server);
    }
  • Zod schema for get_doc_pages input parameters: doc_id, workspace_id (required), and content_format (optional, enum).
    {
      doc_id: z.string().describe('The ID of the doc to get pages from'),
      workspace_id: z.string().describe('The ID of the workspace containing the doc'),
      content_format: z.enum(['text/md', 'text/plain']).optional().describe('The format to return the content in')
    },
  • Helper method DocsClient.getDocPages() that makes the actual ClickUp API v3 call to GET /workspaces/{workspaceId}/docs/{docId}/pages.
    async getDocPages(workspaceId: string, docId: string, contentFormat: string = 'text/md'): Promise<any> {
      // Get the API token directly from the environment variable
      const apiToken = process.env.CLICKUP_API_TOKEN;
      
      try {
        const url = `https://api.clickup.com/api/v3/workspaces/${workspaceId}/docs/${docId}/pages`;
        
        // Use the exact same parameters that worked in the successful request
        const params = { 
          max_page_depth: -1,
          content_format: contentFormat
        };
        
        // Use the exact same headers that worked in the successful request
        const headers = {
          'Authorization': apiToken,
          'Accept': 'application/json'
        };
        
        const response = await axios.get(url, {
          headers,
          params
        });
        
        return response.data;
      } catch (error) {
        console.error('Error getting doc pages:', error);
        throw error;
      }
    }
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 return format, omitting details like pagination, permissions, or error cases.

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?

Two concise sentences, front-loaded with the primary action, every sentence adds value.

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?

No output schema, and the description does not specify the structure of the returned pages (e.g., array with IDs), leaving the response unclear.

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 baseline is 3; the description adds no significant meaning beyond what the schema already provides for parameters.

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 uses a specific verb 'Get' and resource 'pages of a specific ClickUp doc', clearly distinguishing it from sibling tools like get_doc_content or search_docs.

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 pages of a doc, but provides no explicit guidance on when to use this tool over alternatives or when not to use it.

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

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