Skip to main content
Glama

outline_get_document

Retrieve a specific document from Outline by its unique ID to access content for reading, editing, or reference.

Instructions

Get a specific document from Outline by ID

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesThe ID of the document to retrieve

Implementation Reference

  • The handler for 'outline_get_document' in the MCP server, which calls the OutlineClient.getDocument method.
    case 'outline_get_document':
      return {
        content: [
          {
            type: 'text',
            text: JSON.stringify(
              await this.outlineClient.getDocument(args.id as string),
              null,
              2
            ),
          },
        ],
      };
  • The actual implementation of the getDocument method that performs the API request to Outline.
    async getDocument(id: string): Promise<Document> {
      // Try different possible endpoints
      const endpoints = ['/api/documents.info', '/api/documents/info', '/api/document/info'];
    
      for (const endpoint of endpoints) {
        try {
          console.error(`Trying get document endpoint: ${this.api.defaults.baseURL}${endpoint}`);
          const response = await this.api.post(endpoint, { id });
    
          // Debug: log the actual response structure
          console.error('Get document raw response:', JSON.stringify(response.data, null, 2));
    
          const data = response.data.data || response.data;
    
          // Temporarily bypass schema validation and return raw data
          console.error('Returning raw document data:', JSON.stringify(data, null, 2));
          return data as Document;
        } catch (error: any) {
          console.error(`Get document endpoint ${endpoint} failed:`, error.response?.status, error.response?.statusText);
          if (error.response?.status === 404 && endpoint !== endpoints[endpoints.length - 1]) {
            console.error(`Endpoint ${endpoint} not found, trying next...`);
            continue;
          }
          throw error;
        }
      }
      throw new Error('No valid endpoint found for getting document');
    }

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

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