Skip to content

Tools & integrations

A tool is any external capability an agent can invoke during execution. Tools turn a conversational agent into an action-oriented system: they can query databases, call APIs, read files, send messages, or trigger business workflows.

Without tools, an agent is limited to the knowledge in its model and the context provided in the conversation. With tools, an agent can:

  • Retrieve live data that was not available at training time.
  • Perform actions on behalf of a user or process.
  • Enforce business rules by interacting with systems of record.
  • Provide grounded, verifiable answers instead of guesses.

When an agent receives a request, the runtime decides whether a tool is needed and, if so, which one. The result of the tool call is returned to the agent and used to produce the final answer.

flowchart TB
  req(["User request"])
  decide{"Agent evaluates<br/>need for a tool"}
  direct(["Direct answer"])
  invoke["Runtime invokes tool"]
  result["Result returned to agent"]
  final(["Final answer"])

  req --> decide
  decide -->|"no tool needed"| direct
  decide -->|"tool needed"| invoke --> result --> final

A single conversation may involve multiple tool calls. The runtime manages sequencing, retries, and error handling.

CategoryExamples
Data accessQuery a CRM, search a knowledge base, read a document store
ActionCreate a ticket, send a notification, update an order status
ComputationRun a calculation, validate data, transform formats
Human-in-the-loopRequest approval, escalate to a person, confirm a sensitive action

Tools can be integrated in several ways depending on who owns the system and how closely it needs to be governed.

Alquimia Platform includes adapters for common services. These are configured declaratively and are managed by the runtime.

You can register your own tools by exposing them through a standard interface. This is useful when the capability is specific to your business or when you need fine-grained control over behavior.

Model Context Protocol (MCP) servers provide a standardized way to expose tools to agents. MCP tools can be shared across agents and environments, and they support features such as typed schemas and human approval.

MCP servers can be reached over HTTP or, in local/development setups, through a stdio subprocess. Because stdio transport spawns a local command, alquimia-core requires an explicit allow-list before it will launch any stdio server. In production, run stdio MCP servers as separate processes or sidecars and connect the agent to them over HTTP, rather than letting the worker spawn commands directly. See Add a tool for the allow-list variables. MCP timeout defaults are sent in milliseconds, as fastmcp expects.

For governed integrations, prefer a tool_ref to a registered ToolRegistration instead of embedding connection details directly in the agent spec. When tool_ref is used, inline url, headers, and auth are rejected so that a curated tool’s credentials cannot be redirected to an arbitrary host. The registry connector still governs operations by severity and tier, and the assistant-stage authorization policy receives the registry so that registry-classified operations can be routed to approval workflows.

Client-managed tools (provider_id: "client") let callers supply schemas that the runtime executes on their behalf while keeping governance inside the registry. Register a client tool with a curated schema; when a request includes a matching client tool, the runtime strips the request-supplied schema and routes execution through the dedicated ClientToolExecution path. This prevents schema collisions and lets you apply the same severity, tier, and approval controls that server-side tools use.

Tool names are normalized to fit the OpenAI-compatible pattern ^[a-zA-Z0-9_-]{1,64}$. Characters outside that set are removed or replaced deterministically, and the resulting name remains unique within the agent. Tool authors should choose short, descriptive names using letters, numbers, underscores, and hyphens to avoid surprising rewrites.

Well-designed tools make agents more reliable and easier to maintain.

  • Single responsibility — each tool should do one thing. Composable tools are easier to test and reuse.
  • Clear descriptions — the agent chooses tools based on their names and descriptions. Be explicit about inputs, outputs, and side effects.
  • Idempotency — where possible, make repeated calls safe. This helps when the runtime retries a failed invocation.
  • Bounded scope — a tool should return only the data the agent needs. Large responses waste context and can reduce answer quality.
  • Error signals — return structured errors so the agent can explain what happened or try again.

Not every tool should run automatically. Alquimia Platform supports approval workflows for sensitive tools. When configured, the runtime pauses execution, asks a human for confirmation, and only proceeds after receiving an explicit decision. Approvals can be delivered through the same channel the user is already on, such as WhatsApp or Email.

Every tool invocation is traced as part of the agent execution. This lets you audit what actions were taken, by which agent, and in response to which request.