palbaseDocs

Palbase ai · API

PUT/ai/endpoints/{name}

Put a tool endpoint

A tool at an HTTPS address of the project's — called with a signed POST {tool, call_id, input, context: {chat_id, agent, user, metadata, turn_id, run_id, subagent, workspace} — the turn, the run that called: the agent's own, or a subagent's at work (subagent names which, null for the agent), and, in a chat that works in a workspace, the workspace as the session last wrote it, flushed before the call: workspace {chat_id, manifest_id, seq} (read its files at that tree, GET /ai/chats/{chat_id}/workspace/files?manifest=)} — and answered {output, is_error, workspace_tree?} or plain text: a tool that wrote the workspace (PUT /ai/chats/{chat_id}/workspace/files) answers workspace_tree {manifest_id, seq} — the tree its writes left, either or both — and the agent's next command sees it — or an MCP server, whose tools an agent may use: when the project says it is its own (workspace: true), told the same tree in its tools/call's _meta (palbase/workspace), answering it in its result's _meta (palbase/workspace_tree); a third party's server is told nothing of a chat or its workspace. The answer says an https tool's signing secret, once.

Called by your server, with the project's secret key.

Path

namestring · requiredThe name: lowercase letters, digits, _ and -, starting with a letter, at most 64.

Request body

approvalboolean · optionalEvery call waits for a person's yes.
descriptionstring · optionalWhat an https tool does (an MCP server says its own).
kind"https" | "mcp" · requiredhttps (a tool at that address) or mcp (an MCP server: streamable HTTP).
parametersobject · optionalA JSON Schema of type object: what the tool takes.
urlstring · requiredAn https:// address on the public internet.
workspaceboolean · optionalTrue for an endpoint of the project's own — an MCP server or an HTTPS tool — that reads or writes a chat's workspace: each call tells it the tree it is made at (an MCP server in its _meta palbase/workspace, an HTTPS tool in its context.workspace: the chat's id, manifest_id and seq), and the tree its answer names (an MCP result's _meta palbase/workspace_tree, an HTTPS answer's workspace_tree) is waited for. False (the default, which every endpoint put before an HTTPS tool took the setting has): any server's address — a third party's API or MCP server — told nothing of the chat's workspace, a tree it answers ignored. The project's backend's tools are told the workspace always.
auth_mode"project" | "user_oauth" | "user_token" · optionalMCP authentication mode.
oauth_configobject · optionalOAuth 2.1 PKCE configuration when auth_mode is oauth2_pkce.
discovery"auto" | "eager" | "lazy" · optionalMCP tool discovery mode (auto activates lazy search above 32 tools).
auth_headerstring · optionalStatic Authorization header value sealed at rest when auth_mode is static_header.
curl
curl -X PUT "https://<your-ref>.palbase.studio/ai/endpoints/<name>" \
  -H "apikey: $PALBASE_SECRET_KEY" \
  -H "content-type: application/json" \
  -d '{"kind":"https","url":"string"}'

Responses

200The endpoint, with its signing secret

400The request is malformed, or names what this module does not offer (the error names which)

401No valid credential

403A publishable key or a user's session: everything here is the project's server's, called with the secret key

429The project's request rate, or the provider's for its connection, is used up — or the project holds as much as it may at once: 32 open streams at one of the module's servers (too_many_streams), 2 pictures being made (too_many_images), 512 MiB of pictures kept here for their day (image_storage_full), or the service — or the project's share of it — holds as much of its requests at once as it takes: their bodies, an embedding request's vectors, the pictures being made (busy). Retry-After says when to try again

503The model service or the database did not answer; retry shortly

defaultAn error: the envelope names it (`error`) and explains it (`error_description`).

Operation PutEndpoint of ai's contract.