Skip to main content
Glama

list_documents

Retrieve and filter your document list with pagination, search, and status options to manage electronic signatures efficiently.

Instructions

Retrieve a paginated list of documents available in your My Documents section. This API fetches document details such as status, sender, recipient, labels, transmission type, creation date, and modification date, with options for filtering and paginated navigation.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pageSizeYes
pageYes
searchKeyNoOptional. A search term used to filter the document list. The API will return documents matching details like document title, document ID, sender name, or recipient name.
sentByNoOptional. Filter documents by sender email addresses. One or more sender email IDs can be specified.
recipientsNoOptional. Filter documents by signer email addresses. One or more signer email IDs can be specified.
startDateNoOptional. Start transmit date range of the document. The date should be in a valid date-time format.
endDateNoOptional. End transmit date range of the document. The date should be in a valid date-time format.
labelsYesOptional. Labels associated with documents. Used to filter the list by specific document tags.
transmitTypeYesOptional. Type of transmission to filter documents if the user is both sender, recipient or both.Both
statusYesOptional. Filter documents based on their current status.
nextCursorNoOptional. Cursor value for pagination beyond 10,000 records. Set to the cursor of the last retrieved document.
brandIdsNoOptional. Filters documents based on associated brand IDs. Only documents linked to the specified brands will be retrieved.
dateFilterTypeNoOptional. Type of date filter applied to documents. Available options: 'SentBetween' and 'Expiring'.

Implementation Reference

  • The handler function listDocumentsHandler that initializes DocumentApi, calls listDocuments with payload parameters, handles response with handleMcpResponse, and errors with handleMcpError.
    async function listDocumentsHandler(payload: ListDocumentsSchemaType): Promise<McpResponse> {
      try {
        const documentApi = new DocumentApi();
        documentApi.basePath = configuration.getBasePath();
        documentApi.setApiKey(configuration.getApiKey());
        const documentRecords: DocumentRecords = await documentApi.listDocuments(
          payload.page,
          payload.sentBy ?? undefined,
          payload.recipients ?? undefined,
          (payload.transmitType as any) ?? undefined,
          payload.dateFilterType ?? undefined,
          payload.pageSize ?? undefined,
          payload.startDate ?? undefined,
          payload.status ?? undefined,
          payload.endDate ?? undefined,
          payload.searchKey ?? undefined,
          payload.labels ?? undefined,
          payload.nextCursor ?? undefined,
          payload.brandIds ?? undefined,
        );
        return handleMcpResponse({
          data: documentRecords,
        });
      } catch (error: any) {
        return handleMcpError(error);
      }
    }
  • Zod schema defining input parameters for the list_documents tool, including pagination, filters by sender, recipients, dates, labels, status, etc.
    const ListDocumentsSchema = z.object({
      pageSize: z.number().int().min(1).max(100),
      page: z.number().int().min(1).default(1),
      searchKey: commonSchema.OptionalStringSchema.describe(
        'Optional. A search term used to filter the document list. The API will return documents matching details like document title, document ID, sender name, or recipient name.',
      ),
      sentBy: z
        .array(commonSchema.EmailSchema.describe('Email address of the sender.'))
        .optional()
        .describe(
          'Optional. Filter documents by sender email addresses. One or more sender email IDs can be specified.',
        ),
      recipients: z
        .array(commonSchema.EmailSchema.describe('Email address of the signer.'))
        .optional()
        .describe(
          'Optional. Filter documents by signer email addresses. One or more signer email IDs can be specified.',
        ),
      startDate: commonSchema.OptionalDateSchema.describe(
        'Optional. Start transmit date range of the document. The date should be in a valid date-time format.',
      ),
      endDate: commonSchema.OptionalDateSchema.describe(
        'Optional. End transmit date range of the document. The date should be in a valid date-time format.',
      ),
      labels: z
        .array(z.string().describe('Label of the document.'))
        .optional()
        .default([])
        .describe(
          'Optional. Labels associated with documents. Used to filter the list by specific document tags.',
        ),
      transmitType: z
        .enum(['Sent', 'Received', 'Both'])
        .optional()
        .default('Both')
        .describe(
          'Optional. Type of transmission to filter documents if the user is both sender, recipient or both.',
        ),
      status: z
        .array(
          z
            .enum([
              'None',
              'WaitingForMe',
              'WaitingForOthers',
              'NeedAttention',
              'Completed',
              'Declined',
              'Revoked',
              'Expired',
              'Scheduled',
              'Draft',
            ])
            .default('None'),
        )
        .optional()
        .default([])
        .describe('Optional. Filter documents based on their current status.'),
      nextCursor: z
        .number()
        .optional()
        .describe(
          'Optional. Cursor value for pagination beyond 10,000 records. Set to the cursor of the last retrieved document.',
        ),
      brandIds: z
        .array(commonSchema.InputIdSchema.describe('Unique identifier (ID) of the brand.'))
        .optional()
        .describe(
          'Optional. Filters documents based on associated brand IDs. Only documents linked to the specified brands will be retrieved.',
        ),
      dateFilterType: z
        .enum(['SentBetween', 'Expiring'])
        .optional()
        .describe(
          "Optional. Type of date filter applied to documents. Available options: 'SentBetween' and 'Expiring'.",
        ),
    });
  • Tool definition for 'list_documents' including method name, description, input schema, and wrapper handler that delegates to listDocumentsHandler. Exported and included in higher-level tool arrays.
    export const listDocumentsToolDefinition: BoldSignTool = {
      method: ToolNames.ListDocuments.toString(),
      name: 'List documents',
      description:
        'Retrieve a paginated list of documents available in your My Documents section. This API fetches document details such as status, sender, recipient, labels, transmission type, creation date, and modification date, with options for filtering and paginated navigation.',
      inputSchema: ListDocumentsSchema,
      async handler(args: unknown): Promise<McpResponse> {
        return await listDocumentsHandler(args as ListDocumentsSchemaType);
      },
    };
  • Enum definition providing the string tool name 'list_documents' used in the tool definition's method field.
    ListDocuments = 'list_documents',
  • Aggregation of document-related tool definitions into an array, which is then spread into the global tools definitions.
    export const documentsApiToolsDefinitions: BoldSignTool[] = [
      getDocumentPropertiesToolDefinition,
      listDocumentsToolDefinition,
      listTeamDocumentsToolDefinition,
      sendReminderForDocumentToolDefinition,
      revokeDocumentToolDefinition,
    ];
Behavior3/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. It adequately describes the core behavior (retrieving paginated lists with filtering) and mentions what data is returned (status, sender, recipient, etc.). However, it doesn't disclose important behavioral traits like rate limits, authentication requirements, error conditions, or whether this is a read-only operation (though 'retrieve' implies reading).

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?

The description is perfectly structured in two sentences: the first establishes the core purpose, and the second elaborates on capabilities. Every word earns its place - there's no redundancy, and the information is front-loaded with the essential 'retrieve paginated list' concept immediately.

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?

For a complex tool with 13 parameters, no annotations, and no output schema, the description provides adequate but incomplete context. It covers the what (retrieving documents) and some how (filtering, pagination), but doesn't address authentication, error handling, rate limits, or the structure of returned data. Given the complexity, more behavioral context would be beneficial.

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 description coverage is high at 85%, establishing a baseline score of 3. The description adds some value by mentioning 'options for filtering and paginated navigation' which aligns with the schema's many filter parameters and pagination controls. However, it doesn't provide additional semantic context beyond what's already well-documented in the schema descriptions.

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 specific action ('Retrieve a paginated list'), resource ('documents available in your My Documents section'), and scope ('with options for filtering and paginated navigation'). It distinguishes itself from siblings like 'get_document_properties' (which fetches details of a single document) and 'list_team_documents' (which focuses on team-specific documents).

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 context by specifying 'My Documents section' and mentioning filtering/pagination options, but doesn't explicitly state when to use this tool versus alternatives like 'list_team_documents' or 'get_document_properties'. No explicit exclusions or prerequisites are provided, leaving usage guidance at an implied level.

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/boldsign/boldsign-mcp'

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