Loading...
Local Tools
Extend Tambo's capabilities with custom business logic and API integrations.
Local tools are JavaScript functions that execute in your React app. When processing a user message, Tambo may decide to use tools you have registered to retrieve information or to take actions. Local tools allow you to extend the capabilities of Tambo without setting up an MCP server.
const getWeather = (city: string) => {
return `The weather in ${city} is warm and sunny!`;
};
export const tools: TamboTool[] = [
{
name: "getWeather",
description: "A tool to get the current weather conditions of a city",
tool: getWeather,
toolSchema: z
.function()
.args(z.string().describe("The city name to get weather information for"))
.returns(z.string()),
},
];
<TamboProvider tools={tools}>
<App />
</TamboProvider>;