|
| 1 | +# Parseable tool REST API |
| 2 | + |
| 3 | +Parseable owns the canonical tool catalog and execution semantics. External MCP |
| 4 | +servers adapt these REST endpoints to MCP `tools/list` and `tools/call`. |
| 5 | + |
| 6 | +Both endpoints require normal Parseable authentication. Tool execution also |
| 7 | +applies the RBAC action required by the selected tool and any referenced |
| 8 | +dataset or resource. |
| 9 | + |
| 10 | +## List tools |
| 11 | + |
| 12 | +```http |
| 13 | +GET /api/prism/v1/llm/tools/list |
| 14 | +``` |
| 15 | + |
| 16 | +Response: |
| 17 | + |
| 18 | +```json |
| 19 | +{ |
| 20 | + "tools": [ |
| 21 | + { |
| 22 | + "name": "get_dataset_schema", |
| 23 | + "title": "Get dataset schema", |
| 24 | + "description": "Get columns and data types for a dataset.", |
| 25 | + "inputSchema": { |
| 26 | + "type": "object", |
| 27 | + "properties": { "dataset": { "type": "string", "minLength": 1 } }, |
| 28 | + "required": ["dataset"], |
| 29 | + "additionalProperties": false |
| 30 | + } |
| 31 | + } |
| 32 | + ] |
| 33 | +} |
| 34 | +``` |
| 35 | + |
| 36 | +The response includes an `ETag` and |
| 37 | +`Cache-Control: private, max-age=300, must-revalidate`. A request with a |
| 38 | +matching `If-None-Match` receives `304 Not Modified`. |
| 39 | + |
| 40 | +The catalog is edition-specific: |
| 41 | + |
| 42 | +- OSS returns OSS-supported tools. |
| 43 | +- Enterprise returns OSS tools plus Enterprise tools. |
| 44 | +- Parseable Cloud uses the Enterprise server catalog and exposes the tools |
| 45 | + enabled by that deployment. |
| 46 | + |
| 47 | +## Call a tool |
| 48 | + |
| 49 | +```http |
| 50 | +POST /api/prism/v1/llm/tools/call |
| 51 | +Content-Type: application/json |
| 52 | +``` |
| 53 | + |
| 54 | +Request: |
| 55 | + |
| 56 | +```json |
| 57 | +{ |
| 58 | + "name": "get_dataset_schema", |
| 59 | + "arguments": { "dataset": "application-logs" } |
| 60 | +} |
| 61 | +``` |
| 62 | + |
| 63 | +`arguments` must satisfy the tool's `inputSchema`. For mutation and |
| 64 | +external-side-effect tools, the MCP host or another trusted caller is |
| 65 | +responsible for applying its confirmation policy before calling this endpoint. |
| 66 | + |
| 67 | +Successful and failed executions use the MCP `CallToolResult` shape: |
| 68 | + |
| 69 | +```json |
| 70 | +{ |
| 71 | + "content": [ |
| 72 | + { "type": "text", "text": "{\"fields\":[...]}" } |
| 73 | + ], |
| 74 | + "structuredContent": { |
| 75 | + "result": { "fields": [] } |
| 76 | + }, |
| 77 | + "isError": false |
| 78 | +} |
| 79 | +``` |
| 80 | + |
| 81 | +Tool failures set `isError` to `true`, include a text error content item, and |
| 82 | +put the message under `structuredContent.error.message`. A completed tool call |
| 83 | +returns HTTP 200 even when the tool reports `isError: true`, matching MCP |
| 84 | +`tools/call` semantics. REST status codes distinguish failures that prevent a |
| 85 | +call from starting, such as malformed input, authentication, or an unknown |
| 86 | +tool. |
| 87 | + |
| 88 | +The REST API is not itself an MCP transport. An MCP adapter maps the registry |
| 89 | +response to `tools/list`, forwards calls to this endpoint, and returns the |
| 90 | +`CallToolResult` from Parseable through MCP `tools/call`. |
0 commit comments