**Source URL:** https://limited.veevavault.dev/commercial/mcp/vault-mcp-server/reference/tools

# Tools

The Vault MCP Server dynamically exposes Vault AI agent actions as MCP tools.

To be available as a tool, the agent must be active in Vault, the agent action must have [*API Access* enabled](https://platform.veevavault.help/en/lr/950644), and the authenticated user must have the `Execute` permission for that agent.

## List Tools

Call `tools/list` after each session initialization to retrieve the available tool list. The list is user-specific. Configuration changes can take up to 8 hours to appear. Reinitialize the session to refresh.

### Example Request

```json
{
  "jsonrpc": "2.0",
  "id": "req_2",
  "method": "tools/list"
}
```

### Example Response

```json
{
  "jsonrpc": "2.0",
  "id": "req_2",
  "result": {
    "tools": [
      {
        "name": "base_document_chat_agent__sys-summarize_document__sys",
        "title": "Summarize Document",
        "description": "This Action summarizes the document content for the user to quickly understand the main theme and key points of the document.",
        "inputSchema": {
          "type": "object",
          "properties": {
            "document_id": {
              "type": "string",
              "description": "The document id identifies the specific document to use for the tool call. The document id format can be just the id or id plus major and minor version, e.g. just id \"1001\" or id plus version \"1001_1_3\". If just id is provided, the version is automatically assumed by the system to be the latest available version."
            },
            "user_message": {
              "type": "string",
              "description": "Provide an optional message from the user."
            }
          },
          "required": ["document_id"]
        }
      },
      {
        "name": "base_document_chat_agent__sys-ask_questions_on_document__sys",
        "title": "Ask Questions on Document",
        "description": "This action is used for inquiries about the content inside the document and questions about the document's structure, metadata (doc fields), or anything else not inside the document text. It is also used for broad and general questions about the document, including inquiries that are vague, ambiguous, unrelated, or unknown topics and concepts.",
        "inputSchema": {
          "type": "object",
          "properties": {
            "document_id": {
              "type": "string",
              "description": "The document id identifies the specific document to use for the tool call. The document id format can be just the id or id plus major and minor version, e.g. just id \"1001\" or id plus version \"1001_1_3\". If just id is provided, the version is automatically assumed by the system to be the latest available version."
            },
            "user_message": {
              "type": "string",
              "description": "Provide an optional message from the user."
            }
          },
          "required": ["document_id"]
        }
      }
    ]
  }
}
```

## Call a Tool

Use the `tools/call` method to execute a tool. Tool names follow the pattern `{agent_name}-{action_name}`. Pass the document ID or record ID based on the agent's scope.

### Example Request

```json
{
  "jsonrpc": "2.0",
  "id": "req_3",
  "method": "tools/call",
  "params": {
    "name": "base_document_chat_agent__sys-summarize_document__sys",
    "arguments": {
      "document_id": "1001_1_3"
    }
  }
}
```

### Example Response

```json
{
  "jsonrpc": "2.0",
  "id": "req_3",
  "result": {
    "content": [
      {
        "type": "text",
        "text": "This document is a Clinical Study Report for Study XYZ-001, a Phase II randomized controlled trial evaluating the safety and efficacy of the investigational drug in adult patients."
      }
    ]
  }
}
```

Responses stream over Server-Sent Events. The server sends the tool execution ID at the start of the stream, then sends the final result when the action completes.

## Long-Running Tool Calls

The maximum lifetime of a single Transmission Control Protocol (TCP) connection is five minutes. If a tool runs longer than five minutes, the server closes the connection and emits a resume event that includes the `Last-Event-ID`. The action continues processing in the background.

```
id: 432094030943ui034380948390
data: {
  "result": { "content": [{
    "text": "It is taking longer to run this tool. You may resume later using the Last-Event-ID."
  }] }
}
```

To resume, send a `GET` request with the `Mcp-Session-Id` and `Last-Event-ID` from the resume event. The server holds the resumed stream open for up to 30 seconds. If the action completes within that window, the server returns the final result. If the server has not completed the action within that window, the client can send another `GET` request every 30 seconds for up to 1 hour. After 1 hour, the agent action will not execute.

```bash
curl --request GET 'https://myvault.veevavault.com/api/ai/mcp' \
  --header 'Accept: text/event-stream' \
  --header 'Authorization: Bearer {access_token}' \
  --header 'Mcp-Session-Id: 1868a90c-b5f2-4b89-a215-0922c4381023' \
  --header 'Last-Event-ID: 432094030943ui034380948390'
```

To cancel a tool call in progress, send a `notifications/cancelled` notification with the `requestId` of the original `tools/call` request. The server acknowledges with `202 Accepted` and processes the cancellation asynchronously. The `requestId` is the JSON-RPC `id` from the original request, not the server-assigned execution ID.

```json
{
  "jsonrpc": "2.0",
  "method": "notifications/cancelled",
  "params": { "requestId": "req_123", "reason": "User aborted the operation" }
}
```

---

**Previous:** [Reference](/commercial/mcp/vault-mcp-server/reference)  
**Next:** [Errors](/commercial/mcp/vault-mcp-server/reference/errors)