curl --request POST \
--url https://{host}/v2/workspaces/slug:agent-factory/webhooks/v1/agents/{agentId}/tools \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"type": "file_search"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({type: 'file_search'})
};
fetch('https://{host}/v2/workspaces/slug:agent-factory/webhooks/v1/agents/{agentId}/tools', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://{host}/v2/workspaces/slug:agent-factory/webhooks/v1/agents/{agentId}/tools"
payload = { "type": "file_search" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"id": "<string>",
"type": "file_search",
"name": "<string>",
"display_name": "<string>",
"description": "<string>",
"catalog_id": "<string>",
"auth": {},
"icon_url": "<string>",
"vector_store_id": "<string>",
"server": "<string>",
"headers": {},
"scope": "<string>",
"url": "<string>",
"parameters": {}
}{
"error": "<string>",
"message": "<string>",
"details": {}
}{
"error": "<string>",
"message": "<string>",
"details": {}
}{
"error": "<string>",
"message": "<string>",
"details": {}
}{
"error": "<string>",
"message": "<string>",
"details": {}
}{
"error": "<string>",
"message": "<string>",
"details": {}
}{
"error": "<string>",
"message": "<string>",
"details": {}
}Attach a tool to an agent
Adds a tool to the agent’s tools[]. type MUST be one of
file_search, mcp, or function. The tool name must match
^[a-zA-Z0-9_-]+$ (OpenAI tool-name constraint). When the
agent is published, has_draft_changes is set to true.
curl --request POST \
--url https://{host}/v2/workspaces/slug:agent-factory/webhooks/v1/agents/{agentId}/tools \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"type": "file_search"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({type: 'file_search'})
};
fetch('https://{host}/v2/workspaces/slug:agent-factory/webhooks/v1/agents/{agentId}/tools', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://{host}/v2/workspaces/slug:agent-factory/webhooks/v1/agents/{agentId}/tools"
payload = { "type": "file_search" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"id": "<string>",
"type": "file_search",
"name": "<string>",
"display_name": "<string>",
"description": "<string>",
"catalog_id": "<string>",
"auth": {},
"icon_url": "<string>",
"vector_store_id": "<string>",
"server": "<string>",
"headers": {},
"scope": "<string>",
"url": "<string>",
"parameters": {}
}{
"error": "<string>",
"message": "<string>",
"details": {}
}{
"error": "<string>",
"message": "<string>",
"details": {}
}{
"error": "<string>",
"message": "<string>",
"details": {}
}{
"error": "<string>",
"message": "<string>",
"details": {}
}{
"error": "<string>",
"message": "<string>",
"details": {}
}{
"error": "<string>",
"message": "<string>",
"details": {}
}Authorizations
User-bound credential carrying an identity: either a session JWT
or a user access token (at:*) generated from the user settings UI.
Send as Authorization: Bearer <token>.
Org API keys (iak_*) are not accepted here - they carry
no user identity. Use the x-prismeai-api-key header instead
(see OrgApiKeyAuth).
Path Parameters
64Body
file_search, mcp, function 64128^[a-zA-Z0-9_-]+$25640961282048Required for file_search.
128MCP server URL (for mcp).
2048256Required for function.
2048JSON Schema describing the function tool's parameters.
Response
Tool added.
Tool entry attached to an agent. Discriminated by type -
file_search (requires vector_store_id), mcp (uses server,
headers, scope), or function (uses url, parameters,
headers).
file_search, mcp, function ^[a-zA-Z0-9_-]+$Required for file_search.
MCP server URL (for mcp).
Required for function.
JSON Schema describing the function tool's parameters.
Was this page helpful?