Search Indexed Code Memories
search_codeSearch indexed code symbol definitions, file paths, and reference memories within a namespace (read-only, idempotent; consumes 1 Read API call) and return { results, total_candidates } capped at 20 ranked { memory, score } hits. Requires code memories in namespace (populated via /memoreal-sync-code or encode_memory) and rejects reserved "org:" prefixes. Use to discover where functions, classes, or routes live by keyword; use explain_code instead to inspect callers and invariants of a known symbol, or recall_memories for general prose rules.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"namespace": "<namespace>",
"query": "<query>"
},
"name": "search_code"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | Function, class, route, or file keyword to locate. | |
| namespace | Yes | Logical repository or workspace namespace to search (never prefix with "org:"). |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| results | Yes | Top ranked { memory, score } code hits (max 20). | |
| total_candidates | Yes | Total candidate entries scanned in the namespace. |