Skip to main content
Glama

outline_list_documents

Retrieve documents from Outline, with options to filter by collection and limit results for efficient document management.

Instructions

List documents from Outline, optionally filtered by collection

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
collectionIdNoOptional collection ID to filter documents
limitNoMaximum number of results to return (default: 25)

Implementation Reference

  • The implementation of the `listDocuments` method in `OutlineClient` which handles the API request to list Outline documents.
    async listDocuments(collectionId?: string, limit: number = 25): Promise<Document[]> {
      const payload: any = { limit };
      if (collectionId) {
        payload.collection = collectionId;
      }
    
      const endpoints = ['/api/documents.list', '/api/documents/list', '/api/documents', '/api/document/list'];
    
      for (const endpoint of endpoints) {
        try {
          console.error(`Trying endpoint: ${this.api.defaults.baseURL}${endpoint}`);
          const response = await this.api.post(endpoint, payload);
    
          // Debug: log the actual response structure
          console.error('Raw response data:', JSON.stringify(response.data, null, 2));
    
          const data = response.data.data || response.data;
          if (Array.isArray(data) && data.length > 0) {
            console.error('Sample document structure:', JSON.stringify(data[0], null, 2));
          }
    
          // Temporarily bypass schema validation and return raw data
          console.error('Returning raw document list:', JSON.stringify(data, null, 2));
          return data as Document[];
        } catch (error: any) {
          console.error(`Endpoint ${endpoint} failed:`, error.response?.status, error.response?.statusText);
          if (error.response?.status === 404 && endpoint !== endpoints[endpoints.length - 1]) {
            continue;
          }
          throw error;
        }
      }
      throw new Error('No valid endpoint found for listing documents');
    }
  • The MCP handler case for `outline_list_documents` in `src/index.ts`, which calls the client's `listDocuments` method.
    case 'outline_list_documents':
      return {
        content: [
          {
            type: 'text',
            text: JSON.stringify(
              await this.outlineClient.listDocuments(args.collectionId as string, args.limit as number),
              null,
              2
            ),
          },
        ],
      };
  • src/index.ts:46-63 (registration)
    Tool registration for `outline_list_documents` including its schema definition.
      name: 'outline_list_documents',
      description: 'List documents from Outline, optionally filtered by collection',
      inputSchema: {
        type: 'object',
        properties: {
          collectionId: {
            type: 'string',
            description: 'Optional collection ID to filter documents',
          },
          limit: {
            type: 'number',
            description: 'Maximum number of results to return (default: 25)',
            default: 25,
          },
        },
        required: [],
      },
    },

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