Tools summary
Arguments
Each tool takes exactly the arguments its REST counterpart takes as a body and returns exactly what that route returns.
search_memoryisPOST /v1/memory/searchget_memory_contextisPOST /v1/memory/contextteach_memoryisPOST /v1/memory/factsask_workeris the queuedPOST /v1/answersplus the waitwait_for_answerisGET /v1/answers/:answer_idplus the wait
whoami
Reports this connection’s key name, prefix, scopes, audience, and rate limit. Call it first to confirm the connection works and to see what the key is allowed to do.- Scope: none
- Arguments: none
- REST equivalent: none (MCP-only introspection)
search_memory
Searches the workspace brain and returns matching facts, most relevant first. Name theend_user to also reach that person’s own facts.
- Scope:
memory.read - Arguments:
query(string, 1–2000 characters): what to search forlimit(integer, 1–100, default 20): maximum facts to returnend_user(object, optional):{id, name?}to include facts scoped to this person
- REST equivalent:
POST /v1/memory/search
get_memory_context
Builds the rendered memory context packet for a query: the same block the Alfera worker gets each turn, constrained to a token budget. Use this to paste company context into your own prompt.- Scope:
memory.read - Arguments:
query(string, 1–2000 characters): the query to build context aroundtoken_budget(integer, 100–20000, default 1500): how many tokens to allocate to the context blockend_user(object, optional):{id, name?}to include facts scoped to this person
- REST equivalent:
POST /v1/memory/context
teach_memory
Teaches the workspace brain new facts. Each fact runs through the normal capture pipeline. Repeats of something already known are skipped automatically.- Scope:
memory.write - Arguments:
facts(array, 1–20 items): each item is{text}with up to 4000 characters
- REST equivalent:
POST /v1/memory/facts
ask_worker
Asks the workspace worker a question and waits up totimeout_seconds for the answer. Long answers take minutes, so the wait may time out. When that happens the tool returns an answer_id you can poll with wait_for_answer.
- Scope:
answers.write - Arguments:
input(string, 1–8000 characters): the question or taskconversation_id(string): a stable identifier for the conversation threadend_user(object, optional):{id, name?}agent_slug(string): which worker agent to route totimeout_seconds(integer, 0–120, default 60): how long to wait for the answeridempotency_key(string, 1–200 characters): a client-generated key to deduplicate requests
- REST equivalent: queued
POST /v1/answersplus the wait
wait_for_answer
Keeps waiting for an answer started earlier by itsanswer_id. Each call is a fresh bounded wait, and the answer keeps running the whole time.
- Scope:
answers.write - Arguments:
answer_id(string): the identifier returned by a previousask_workercalltimeout_seconds(integer, 0–120, default 60): how long to wait on this call
- REST equivalent:
GET /v1/answers/:answer_idplus the wait
Waiting for an answer
ask_worker queues the question and waits up to timeout_seconds. Answers take seconds to minutes, so long ones outlast the wait. When that happens you get a result, not an error:
wait_for_answer with that answer_id to keep waiting:
Idempotency
Always sendidempotency_key. Re-calling ask_worker after a timeout without the same key is a new question and a second run: double the cost, two answers, and the conversation lock making them queue behind each other.
The same key with the same arguments returns the same answer_id and starts nothing. The same key with a different question is refused as idempotency_key_reused.
Skip the wait
Settimeout_seconds: 0 to skip the wait and return the answer_id straight away.
Finished answer
A finished answer comes back whole. Both answer tools always includesources.
Errors
Credential problems
A bad, revoked, or expired key fails the request itself with401, before any tool runs:
429 rate_limited. The limit is per key, so give each client its own key.
Tool errors
Everything a tool decides comes back as a readable tool result, withisError: true and a JSON body your agent can act on:
-32601 and -32602), because the request never reached a tool.