agents_add_file
Attach a file to this agent's private knowledge (agent-specific files, not shared with other agents).
Workflow:
Upload the file with files_upload (pass source_url for remote files)
Index it with files_ingest (pass the file_id)
Call this tool with agent_id + file_id
Returns chunk_count — shows 0 while still processing. Call agents.list_files later to see the final chunk count once indexing completes.
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": {
"agent_id": "<agent_id>",
"file_id": "<file_id>"
},
"name": "agents_add_file"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| file_id | Yes | file_id returned by files_upload or files_ingest | |
| agent_id | Yes | ID of the agent to attach the file to | |
| in_workspace | No | Run this one call in this workspace id instead of the session's. Nothing is stored; other sessions are not affected. |