Skip to main content
Glama

get_doc_content

Retrieve the full content of a ClickUp document by specifying the document ID and workspace. Returns combined text from all pages.

Instructions

Get the content of a specific ClickUp doc. Returns combined content from all pages in the doc.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
doc_idYesThe ID of the doc to get
workspace_idYesThe ID of the workspace containing the doc

Implementation Reference

  • The main handler function for the get_doc_content tool. Calls docsClient.getDocPages() to retrieve pages, then combines their content into a single text output.
    async ({ doc_id, workspace_id }) => {
      try {
        // Get the pages of the doc
        const pages = await docsClient.getDocPages(workspace_id, doc_id);
        
        // Combine the content of all pages
        let combinedContent = '';
        if (Array.isArray(pages)) {
          for (const page of pages) {
            if (page.content) {
              combinedContent += page.content + '\n\n';
            }
          }
        }
        
        return {
          content: [{ type: 'text', text: combinedContent || 'No content found in this doc.' }]
        };
      } catch (error: any) {
        console.error('Error getting doc content:', error);
        return {
          content: [{ type: 'text', text: `Error getting doc content: ${error.message}` }],
          isError: true
        };
      }
    }
  • Registration of the get_doc_content tool using server.tool() with Zod schema for doc_id and workspace_id parameters.
    // Register get_doc_content tool
    server.tool(
      'get_doc_content',
      'Get the content of a specific ClickUp doc. Returns combined content from all pages in the doc.',
      {
        doc_id: z.string().describe('The ID of the doc to get'),
        workspace_id: z.string().describe('The ID of the workspace containing the doc')
      },
      async ({ doc_id, workspace_id }) => {
        try {
          // Get the pages of the doc
          const pages = await docsClient.getDocPages(workspace_id, doc_id);
          
          // Combine the content of all pages
          let combinedContent = '';
          if (Array.isArray(pages)) {
            for (const page of pages) {
              if (page.content) {
                combinedContent += page.content + '\n\n';
              }
            }
          }
          
          return {
            content: [{ type: 'text', text: combinedContent || 'No content found in this doc.' }]
          };
        } catch (error: any) {
          console.error('Error getting doc content:', error);
          return {
            content: [{ type: 'text', text: `Error getting doc content: ${error.message}` }],
            isError: true
          };
        }
      }
    );
  • Input schema for get_doc_content tool: doc_id (string) and workspace_id (string) using Zod validation.
    {
      doc_id: z.string().describe('The ID of the doc to get'),
      workspace_id: z.string().describe('The ID of the workspace containing the doc')
    },
  • The getDocPages() method on DocsClient that makes the actual v3 API call to fetch doc pages from ClickUp.
    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;
      }
    }
Behavior3/5

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

No annotations provided, so description must carry the burden. It mentions returning combined content from all pages, but lacks details on authentication, rate limits, or that it is a read-only operation. Basic transparency but not extensive.

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?

Two sentences, front-loaded with purpose. No wasted words, efficient and clear.

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

Completeness3/5

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

No output schema provided, yet description does not detail return format or limitations. For a simple tool it's adequate but could be more complete.

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 additional meaning to the parameters beyond what the schema already 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 verb 'Get' and the resource 'content of a specific ClickUp doc', and distinguishes from sibling tools like 'get_doc_pages' by mentioning it returns combined content from all pages.

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?

No explicit guidance on when to use this vs alternatives like 'search_docs' or 'get_doc_pages'. The purpose is implied but no clear usage context provided.

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