Loading...
Local Resources
Provide context data and documents to Tambo without setting up an MCP server.
Local resources are static or dynamic data sources registered in your React app. When the AI processes a user message, it can request access to resources you have registered to retrieve context, documentation, or other data. Local resources allow you to provide context to Tambo without setting up an MCP server.
const resources: ListResourceItem[] = [
{
uri: "docs://getting-started",
name: "Getting Started Guide",
description: "Introduction to our product",
mimeType: "text/plain",
},
];
export const getResource = async (uri: string) => {
if (uri === "docs://getting-started") {
return {
contents: [
{
uri,
mimeType: "text/plain",
text: "Welcome to our product! Here's how to get started...",
},
],
};
}
throw new Error(`Resource not found: ${uri}`);
};
<TamboRegistryProvider
resources={resources}
listResources={async () => resources}
getResource={getResource}
>
<App />
</TamboRegistryProvider>;