query_contract
Retrieve contract details, status, PDF URL, metadata, and signer information for eSignature agreements using a contract ID. Ideal for tracking and managing signed documents.
Instructions
Responds with the contract details, contract_id, status, final PDF url if present, title, labels, metadata, expiry time if present, and signer details with all signer events (signer events are included only for recent contracts, with rate limiting).
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| contract_id | Yes | GUID of the contract (draft contracts can't be queried, only sent contracts). |
Implementation Reference
- The handler logic for the 'query_contract' tool. It performs a GET request to the eSignatures API using the provided contract_id and returns the response as text content.if name == "query_contract": response = await httpxClient.get(f"/api/contracts/{arguments.get('contract_id')}?token={secret_token}") return [types.TextContent(type="text", text=f"Response code: {response.status_code}, response: {response.json()}")]
- Pydantic/JSON schema defining the input parameters for the 'query_contract' tool, which requires a 'contract_id' string.INPUT_SCHEMA_QUERY_CONTRACT = { "type": "object", "properties": { "contract_id": {"type": "string", "description": "GUID of the contract (draft contracts can't be queried, only sent contracts)."}, }, "required": ["contract_id"], }
- src/mcp_server_esignatures/server.py:34-38 (registration)Tool registration in the @server.list_tools() handler, defining name, description, and inputSchema for 'query_contract'.types.Tool( name="query_contract", description="Responds with the contract details, contract_id, status, final PDF url if present, title, labels, metadata, expiry time if present, and signer details with all signer events (signer events are included only for recent contracts, with rate limiting).", inputSchema=INPUT_SCHEMA_QUERY_CONTRACT ),