search_documents
Search documents by full text, reading each as it is now and never an earlier version.
read-onlyidempotentMCP toolAgent
Calling it#
curl -X POST http://127.0.0.1:8787/komrad.agent.v1.AgentService/SearchDocuments \
-H 'Content-Type: application/json' \
-d '{
"query": "<query>"
}'komrad rpc search-documents \
--query '<string>'{
"name": "search_documents",
"arguments": {
"query": "<query>"
}
}Offered by the komrad MCP server to writer, reviewer, orchestrator agents.
Request#
SearchDocumentsRequest#
| Field | Type | Description |
|---|---|---|
query | string* at most 500 characters | The words to search for in each document's newest version, matched whole and stemmed. A quoted phrase matches in order, and a leading minus excludes a word. |
agent_id | uuid | The agent whose documents to search, by id. Unset searches every agent's, archived agents included. |
type | string not empty at most 100 characters | The type of documents to search, by name. Unset searches every type. |
limit | int32 between 0 and 200 | How many documents to return across |
Response#
SearchDocumentsResponse#
| Field | Type | Description |
|---|---|---|
matches | DocumentHit[] | The documents that contain every word, best match first. |
near | DocumentHit[] | The documents that contain a word only inside a longer word, closest first. |
Types#
DocumentHit#
DocumentHit is one document that matched a search.
| Field | Type | Description |
|---|---|---|
document_id | uuid* | The document's id. |
agent_id | uuid* | The id of the agent that owns the document. |
name | string | The document's title. |
snippet | string | The text around the match, with the matched words marked. |