searchKnowledge
Search the knowledge base
Full-text search across the knowledge documents you can see (case-insensitive substring). Returns matching document paths with line numbers and snippets. Then use readDoc to read the full document. Optionally restrict to one project.
Arguments
| Argument | Type | Required | Description |
|---|---|---|---|
query | string | required | Text to search for |
project | string | optional | Optional project id to restrict the search |
Scopes
knowledge:read
Annotations
- Read only: yes
- Destructive: no
When to use
Use searchKnowledge to find which documents mention a subject. Then read the full document with readDoc.
The tool needs the knowledge:read scope.
- The search is a plain, case-insensitive text match. It is not a semantic search. If you find nothing, try a few other words before you decide that the subject is not documented.
querymust have at least 2 characters.- Without
project, the search covers every project that this person can see. Withproject, it covers that project only. - It returns at most 40 results, and one result for each file: the first line that matches.
- It skips files larger than 2 MB. It covers the same file types as
listDocs. - Each
pathstarts with the project id, for examplenorthwind-advisory/pricing-policy.md. Pass that path toreadDocas it is, with noproject. This differs fromlistDocs, whose paths have no project prefix.
A member searches their own home and each ordinary project where they hold a grant. Admin and staff search every active ordinary project, but no member home.
Example
{ "query": "maximum discount", "project": "northwind-advisory" }
{
"query": "maximum discount",
"results": [
{ "path": "northwind-advisory/2026-q2-pricing-review.md", "line": 20, "snippet": "2. The maximum discount stays at 10 per cent. Partners asked that every discount above 5 per cent is recorded in the proposal log with its reason." },
{ "path": "northwind-advisory/meetings/meeting-2026-08-14-pricing.md", "line": 9, "snippet": "Discussion: the commercial lead said the pricing policy sets the maximum discount at 10 per cent. Two partners said that the volume of work justifies more. One partner said a larger discount would set a precedent for other public-sector clients." },
{ "path": "northwind-advisory/pricing-policy.md", "line": 24, "snippet": "The maximum discount is 10 per cent of the fee. A discount needs a partner's approval. We give a discount only for one of these reasons:" }
],
"truncated": false
}
When truncated is true, the search stopped at 40 results. Make the query narrower, or name a project.
Refusals and what to do
Error in searchKnowledge: Not found: theprojectyou named does not exist, or this person cannot see it. CalllistProjectsand use an id from that list, or leaveprojectout.- A
queryshorter than 2 characters is refused as invalid arguments. - If the connection does not hold
knowledge:read, the tool is not in your tool list, and a call to it returnsMCP error -32602: Tool searchKnowledge not found. Read thepermissionssection ofgetDocs. A scope is never added to an existing connection: the person must reconnect, or mint a new token, withknowledge:read. - An empty
resultslist is not an error. Try other words.
Related
readDocreads a document that the search found.listProjectsgives the project ids.listDocslists every document in one project.getDocshas alimitssection with the search limits.