MCP reference¶
Every tool and resource of the Klaris MCP server, version 1.2.0. The server is at https://app.klarislabs.com/mcp (Streamable HTTP; on-premises: your own Klaris address). Every call carries the person's token: see Sign your people in.
Note
This page is made from the MCP server's own tool list each time the docs are built.
Server instructions¶
What the server tells the app's model about itself (instructions in its initialize reply):
Klaris answers questions about this person's business from their company's own data, as that person, within their role. Pass the person's question as they asked it. When Klaris asks something back, or needs a yes before running a query, show it to the person and answer with their words. A long answer may come back as status working: fetch it with get_answer. A file Klaris makes comes as a resource link (klaris://files/…): read it with resources/read and give it to the person.
Tools¶
| Tool | What it does |
|---|---|
ask |
Ask Klaris |
answer_approval |
Answer a Klaris approval |
get_answer |
Get a Klaris answer |
list_conversations |
List Klaris chats |
get_conversation |
Read a Klaris chat |
delete_conversation |
Delete a Klaris chat |
list_sources |
What Klaris can read |
get_table_rows |
More rows of a Klaris table |
ask¶
Ask Klaris. Reads only.
Ask Klaris about the business, as the signed-in person: figures, lists, trends, charts. Pass the person's question as they asked it. Leave out conversation_id to start a new chat; pass it to follow up in the same chat (a long chat is fine: Klaris summarises its older part itself). If status is working, the answer isn't ready yet: call get_answer with the conversation_id. If status is needs_answer, show the question to the person and ask again in the same chat with their reply. If status is needs_approval, show the approvals (with their SQL) and call answer_approval with their decision.
Arguments
| Argument | Type | What it is | |
|---|---|---|---|
question |
string | required | The person's question or reply, in their own words. |
conversation_id |
string | The chat to continue (conv_…), from an earlier answer. Leave out to start a new chat. |
Returns (structuredContent)
| Field | Type | What it is | |
|---|---|---|---|
conversation_id |
string | required | Pass to ask to continue this chat. |
status |
answered · needs_answer · needs_approval · working · failed · stopped |
required | answered: done. needs_answer: show question to the person and ask again in this chat with their reply. needs_approval: show approvals and call answer_approval with their yes or no. working: not ready yet; call get_answer with this conversation_id. failed or stopped: answer says why; the person may ask again. |
answer |
string | required | Klaris's answer, in Markdown. |
question |
object | When status is needs_answer: a lead line and short questions (header, text, options with meanings). | |
approvals |
list of Approval | When status is needs_approval: what Klaris wants to run, waiting for the person's yes or no. | |
outputs |
list of object | Tables, charts, single numbers and files it made (kind table, chart, metric or file). A table: columns, up to 50 rows, row_count, table_id for more rows (get_table_rows); a chart: its encoding; a file: file.filename, file.format, file.media_type, file.size_bytes and file.uri, read with resources/read (also sent as a resource link). | |
steps |
list of string | What it did, in plain words. |
Approval
| Field | Type | What it is | |
|---|---|---|---|
approval_id |
string | required | Pass to answer_approval with the person's yes or no. |
summary |
string | required | What it would do, in plain words. |
sql |
string | The query it would run, to show the person. |
answer_approval¶
Answer a Klaris approval. Acts on the person's own decision.
Give the person's yes or no to something Klaris asked to do (a query). Only with the person's own answer: never approve on their behalf. Klaris then carries on and answers (status working: call get_answer).
Arguments
| Argument | Type | What it is | |
|---|---|---|---|
conversation_id |
string | required | The chat's id (conv_…), from an earlier answer or list_conversations. |
approval_id |
string | required | The approval's id (apr_…), from the answer's approvals. |
approve |
boolean | required | The person's own decision: true for yes, false for no. |
reason |
string | Optional: why they said no, in their words. |
Returns (structuredContent)
| Field | Type | What it is | |
|---|---|---|---|
conversation_id |
string | required | Pass to ask to continue this chat. |
status |
answered · needs_answer · needs_approval · working · failed · stopped |
required | answered: done. needs_answer: show question to the person and ask again in this chat with their reply. needs_approval: show approvals and call answer_approval with their yes or no. working: not ready yet; call get_answer with this conversation_id. failed or stopped: answer says why; the person may ask again. |
answer |
string | required | Klaris's answer, in Markdown. |
question |
object | When status is needs_answer: a lead line and short questions (header, text, options with meanings). | |
approvals |
list of Approval | When status is needs_approval: what Klaris wants to run, waiting for the person's yes or no. | |
outputs |
list of object | Tables, charts, single numbers and files it made (kind table, chart, metric or file). A table: columns, up to 50 rows, row_count, table_id for more rows (get_table_rows); a chart: its encoding; a file: file.filename, file.format, file.media_type, file.size_bytes and file.uri, read with resources/read (also sent as a resource link). | |
steps |
list of string | What it did, in plain words. |
Approval
| Field | Type | What it is | |
|---|---|---|---|
approval_id |
string | required | Pass to answer_approval with the person's yes or no. |
summary |
string | required | What it would do, in plain words. |
sql |
string | The query it would run, to show the person. |
get_answer¶
Get a Klaris answer. Reads only.
The answer to the latest question in one of the person's chats. Call it when ask or answer_approval returned status working: it waits up to about 40 seconds for the answer. If it is still not ready, it returns status working again: call it again.
Arguments
| Argument | Type | What it is | |
|---|---|---|---|
conversation_id |
string | required | The chat's id (conv_…), from an earlier answer or list_conversations. |
Returns (structuredContent)
| Field | Type | What it is | |
|---|---|---|---|
conversation_id |
string | required | Pass to ask to continue this chat. |
status |
answered · needs_answer · needs_approval · working · failed · stopped |
required | answered: done. needs_answer: show question to the person and ask again in this chat with their reply. needs_approval: show approvals and call answer_approval with their yes or no. working: not ready yet; call get_answer with this conversation_id. failed or stopped: answer says why; the person may ask again. |
answer |
string | required | Klaris's answer, in Markdown. |
question |
object | When status is needs_answer: a lead line and short questions (header, text, options with meanings). | |
approvals |
list of Approval | When status is needs_approval: what Klaris wants to run, waiting for the person's yes or no. | |
outputs |
list of object | Tables, charts, single numbers and files it made (kind table, chart, metric or file). A table: columns, up to 50 rows, row_count, table_id for more rows (get_table_rows); a chart: its encoding; a file: file.filename, file.format, file.media_type, file.size_bytes and file.uri, read with resources/read (also sent as a resource link). | |
steps |
list of string | What it did, in plain words. |
Approval
| Field | Type | What it is | |
|---|---|---|---|
approval_id |
string | required | Pass to answer_approval with the person's yes or no. |
summary |
string | required | What it would do, in plain words. |
sql |
string | The query it would run, to show the person. |
list_conversations¶
List Klaris chats. Reads only.
The signed-in person's Klaris chats, newest first.
Arguments
| Argument | Type | What it is | |
|---|---|---|---|
limit |
integer | How many, newest first (1 to 100). · default 20 |
Returns (structuredContent)
| Field | Type | What it is | |
|---|---|---|---|
chats |
list of Chat | required |
Chat
| Field | Type | What it is | |
|---|---|---|---|
conversation_id |
string | required | |
title |
string | required | |
updated_at |
integer | required |
get_conversation¶
Read a Klaris chat. Reads only.
One of the person's chats: what was said, and anything still waiting for them.
Arguments
| Argument | Type | What it is | |
|---|---|---|---|
conversation_id |
string | required | The chat's id (conv_…), from an earlier answer or list_conversations. |
Returns (structuredContent)
| Field | Type | What it is | |
|---|---|---|---|
conversation_id |
string | required | |
messages |
list of object | required | role (user or klaris) and text, in order. |
waiting |
Answer | A question or yes still waiting, if any. |
Answer
| Field | Type | What it is | |
|---|---|---|---|
conversation_id |
string | required | Pass to ask to continue this chat. |
status |
answered · needs_answer · needs_approval · working · failed · stopped |
required | answered: done. needs_answer: show question to the person and ask again in this chat with their reply. needs_approval: show approvals and call answer_approval with their yes or no. working: not ready yet; call get_answer with this conversation_id. failed or stopped: answer says why; the person may ask again. |
answer |
string | required | Klaris's answer, in Markdown. |
question |
object | When status is needs_answer: a lead line and short questions (header, text, options with meanings). | |
approvals |
list of Approval | When status is needs_approval: what Klaris wants to run, waiting for the person's yes or no. | |
outputs |
list of object | Tables, charts, single numbers and files it made (kind table, chart, metric or file). A table: columns, up to 50 rows, row_count, table_id for more rows (get_table_rows); a chart: its encoding; a file: file.filename, file.format, file.media_type, file.size_bytes and file.uri, read with resources/read (also sent as a resource link). | |
steps |
list of string | What it did, in plain words. |
Approval
| Field | Type | What it is | |
|---|---|---|---|
approval_id |
string | required | Pass to answer_approval with the person's yes or no. |
summary |
string | required | What it would do, in plain words. |
sql |
string | The query it would run, to show the person. |
delete_conversation¶
Delete a Klaris chat. Acts on the person's own decision.
Delete one of the person's chats, with the rows and files Klaris kept for it. Only when the person asks.
Arguments
| Argument | Type | What it is | |
|---|---|---|---|
conversation_id |
string | required | The chat's id (conv_…), from an earlier answer or list_conversations. |
Returns text (Markdown).
list_sources¶
What Klaris can read. Reads only.
The data this person can ask about: the workspace's connections and the business tables in its data model, within their role.
No arguments.
Returns text (Markdown).
get_table_rows¶
More rows of a Klaris table. Reads only.
More rows of a table Klaris made in one of the person's chats (its id, tbl_…, is in an answer's outputs). An answer carries the first 50 rows; page through the rest with offset, up to 200 rows a call. Totals and groupings over the whole table are better asked of Klaris (ask, in the same chat) than added up here.
Arguments
| Argument | Type | What it is | |
|---|---|---|---|
table_id |
string | required | The table's id (tbl_…), from an answer's outputs. |
offset |
integer | How many rows to skip: 50 for the rows after the answer's. · default 0 |
|
limit |
integer | How many rows, up to 200. · default 50 |
Returns (structuredContent)
| Field | Type | What it is | |
|---|---|---|---|
table_id |
string | required | |
columns |
list of string | required | |
rows |
list of list of any | required | |
offset |
integer | required | Where these rows start (0 is the first row). |
row_count |
integer | required | How many rows the table has in all. |
more |
boolean | required | True when rows follow this page: ask again with offset + the rows returned. |
Resources¶
Read with resources/read and the address; the reply is the content as blob (base64) with its mimeType.
| Address | What it is |
|---|---|
klaris://files/{file_id} |
A file Klaris made in one of the signed-in person's chats (Excel or CSV). Its address comes in an answer's outputs and resource links. |