Client tools
Let the agent act inside your editor or plugin: what a client tool is, why tools belong to a session, and the whole flow in one page.
The agent can do more than generate audio. If your product is an editor, a plugin or anything scriptable (Premiere, Resolve, a DAW, your own app), the agent can ask your app to do things: place a clip, add a marker, read the selection. Those things are your client tools. You describe them once, the agent decides when to use them, and your code runs them.
Client tools are different from the MCP tools in AI tools. MCP tools are tools the Falcore server gives an AI assistant. Client tools are tools your app gives Falcore's agent.
The whole flow
- Describe each tool: a name, a description that tells the agent when to use it, and its arguments.
- Register the tools for a session. Registration is a call that costs nothing to repeat.
- Chat with the agent in that session and say you have tools (
tools=True). If a tool would help, the agent stops and sends atool_callevent naming the tool and its arguments. - Run the tool in your app and answer with a
client_tool_result(success: truewith data, orsuccess: falsewith an error). A failure is a normal answer: the agent reads it and decides what to do next. - Repeat until the agent sends
done.
The SDK's tool runner does steps 3 to 5 for you. You only write the function that runs each tool.
from falcore import Catalyst, ClientToolRunner, Param, Tool
catalyst = Catalyst() # creates this client's session
runner = ClientToolRunner(catalyst, "sdk")
runner.add(
Tool("place_clip", "Place an audio file on the timeline",
params=[Param("file_id", "string", "The file to place", required=True),
Param("start", "number", "Start time in seconds", required=True)]),
lambda call: {"track": 2, "offset": call.arguments["start"]}, # runs in YOUR app
)
answer = runner.run(message="Put a whoosh at 2.5 seconds")
print(answer.reply)Output from the local mock server (a real run of the SDK against mock_server.py; the real agent chooses its own words):
agent asked for: place_clip {'file_id': 'fil_demo', 'start': 2.5}
agent says: Done, it is on the timeline.Why tools belong to a session
A session is one conversation with its own files, timeline and history. Your app almost always has a notion of "who is asking": one editor window, one project, one customer. Tools can differ between them: the project that is open decides which tracks exist, which plugin version is running decides what a tool can do. So tools are registered for a session:
- One session per user (a SaaS where each customer has their own project): every customer's tools stay separate, and one customer can never make the agent call a tool that only another customer's app has.
- One session per client (a desktop app that many people install): each installed copy registers what it can run.
- One session for everything (a script, a single-user tool): do nothing. The SDK made one for you when you built the client, and every call uses it.
Create the client, and the session exists. Every later call (wave, composer, chat, tools, download) uses it. To work in another session, switch with update_session_id; see Sessions and tool scope.
What is in this section
| Page | Read it to |
|---|---|
| Describe and register tools | Write a tool, pick a mode, handle a refused tool. |
| Sessions and tool scope | Give each user or client their own tools, and understand the client:session identifier. |
| List and delete tools | See what is registered and remove tools. |
| Run tools with the agent | Understand the call and answer loop, editor_context and needs_video. |
| Client tools reference | Every parameter, every default, every error. |