revoke_document
Cancel an in-progress document signing process to prevent signers from viewing or signing it. Provide a document ID and reason to revoke access.
Instructions
The document signing process can be called off or revoked by the sender of the document. Once you revoke a document, signers can no longer view or sign it. Revoke action can only be performed on the in-progress status documents.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| documentId | Yes | Required. The unique identifier (ID) of the document to revoke. This can be obtained from the list documents tool. | |
| message | Yes | The exact reason for performing a revoke action. | |
| onBehalfOf | No | Optional. Email address of the sender when creating a document on their behalf. This email can be retrieved from the `behalfOf` property in the get document or list documents tool. |
Implementation Reference
- Core handler function that initializes the BoldSign DocumentApi, constructs the RevokeDocument request from input payload, calls the revokeDocument API method, handles the response, and catches errors using utility functions.async function revokeDocumentHandler(payload: RevokeDocumentSchemaType): Promise<McpResponse> { try { const documentApi = new DocumentApi(); documentApi.basePath = configuration.getBasePath(); documentApi.setApiKey(configuration.getApiKey()); const revokeDocumentRequest: RevokeDocument = new RevokeDocument(); revokeDocumentRequest.message = payload.message; revokeDocumentRequest.onBehalfOf = payload.onBehalfOf; const documentResponse: returnTypeI = await documentApi.revokeDocument( payload.documentId, revokeDocumentRequest, ); return handleMcpResponse({ data: documentResponse?.response?.data ?? documentResponse, }); } catch (error: any) { return handleMcpError(error); } }
- Zod input schema for the revoke_document tool, validating documentId (required), message (string), and optional onBehalfOf (email).const RevokeDocumentSchema = z.object({ documentId: commonSchema.InputIdSchema.describe( 'Required. The unique identifier (ID) of the document to revoke. This can be obtained from the list documents tool.', ), message: z.string().describe('The exact reason for performing a revoke action.'), onBehalfOf: commonSchema.EmailSchema.optional() .nullable() .describe( 'Optional. Email address of the sender when creating a document on their behalf. This email can be retrieved from the `behalfOf` property in the get document or list documents tool.', ), });
- src/tools/documentsTools/revokeDocument.ts:23-32 (registration)Tool definition object registering the 'revoke_document' tool (method name), description, input schema, and wrapper handler delegating to the core revokeDocumentHandler.export const revokeDocumentToolDefinition: BoldSignTool = { method: ToolNames.RevokeDocument.toString(), name: 'Revoke document', description: 'The document signing process can be called off or revoked by the sender of the document. Once you revoke a document, signers can no longer view or sign it. Revoke action can only be performed on the in-progress status documents.', inputSchema: RevokeDocumentSchema, async handler(args: unknown): Promise<McpResponse> { return await revokeDocumentHandler(args as RevokeDocumentSchemaType); }, };
- src/tools/documentsTools/index.ts:8-14 (registration)Inclusion of revokeDocumentToolDefinition in the array of documents API tool definitions, which is later aggregated in src/tools/index.ts.export const documentsApiToolsDefinitions: BoldSignTool[] = [ getDocumentPropertiesToolDefinition, listDocumentsToolDefinition, listTeamDocumentsToolDefinition, sendReminderForDocumentToolDefinition, revokeDocumentToolDefinition, ];
- src/tools/index.ts:8-14 (registration)Aggregation of all BoldSign tools including documentsApiToolsDefinitions (containing revoke_document) into the main definitions array used for MCP tool registration.export const definitions: BoldSignTool[] = [ ...contactsApiToolsDefinitions, ...documentsApiToolsDefinitions, ...templatesApiToolsDefinitions, ...usersApiToolsDefinitions, ...teamsApiToolsDefinitions, ];