get_document_properties
Retrieve document details including status, metadata, sender and signer information, form fields, and history from BoldSign by providing the document ID.
Instructions
Retrieve comprehensive details of a document in your BoldSign organization. This API allows authorized users, including senders, signers, team admins, and account admins, to access document properties by specifying the unique document ID. The response includes information such as status, metadata, sender and signer details, form fields, and document history. If an unauthorized user attempts to access the document, an unauthorized response will be returned.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| documentId | Yes | Required. The unique identifier (ID) of the document to retrieve. This can be obtained from the list documents tool. |
Implementation Reference
- The core handler function that executes the tool logic by calling the BoldSign DocumentApi to retrieve document properties based on the provided document ID, handles errors, and formats the MCP response.async function getDocumentPropertiesHandler(payload: GetDocumentPropertiesSchemaType): Promise<McpResponse> { try { const documentApi = new DocumentApi(); documentApi.basePath = configuration.getBasePath(); documentApi.setApiKey(configuration.getApiKey()); const documentProperties: DocumentProperties = await documentApi.getProperties(payload.documentId); return handleMcpResponse({ data: documentProperties, }); } catch (error: any) { return handleMcpError(error); } }
- Zod schema defining the input structure for the tool, requiring a documentId.const GetDocumentPropertiesSchema = z.object({ documentId: commonSchema.InputIdSchema.describe( 'Required. The unique identifier (ID) of the document to retrieve. This can be obtained from the list documents tool.', ), });
- src/tools/documentsTools/getDocumentProperties.ts:17-26 (registration)The tool definition object that registers the tool with its method name 'get_document_properties', description, input schema, and a wrapper handler calling the main handler.export const getDocumentPropertiesToolDefinition: BoldSignTool = { method: ToolNames.GetDocumentProperties.toString(), name: 'Get document properties', description: 'Retrieve comprehensive details of a document in your BoldSign organization. This API allows authorized users, including senders, signers, team admins, and account admins, to access document properties by specifying the unique document ID. The response includes information such as status, metadata, sender and signer details, form fields, and document history. If an unauthorized user attempts to access the document, an unauthorized response will be returned.', inputSchema: GetDocumentPropertiesSchema, async handler(args: unknown): Promise<McpResponse> { return await getDocumentPropertiesHandler(args as GetDocumentPropertiesSchemaType); }, };