Codebuff

find-food

v0.0.8
Published May 22, 2026

Usage Statistics
v0.0.8

Definition

Loading dependencies...
const agentDefinition = {
id: "find-food",
displayName: "Find Food",
publisher: "tanzeela",
version: "0.0.8",
model: "anthropic/claude-4-sonnet-20250522",
toolNames: [
"spawn_agents",
"run_terminal_command",
"add_message"
],
spawnableAgents: [
],
inputSchema: {
params: {
type: "object",
properties: {
location: {
type: "string",
description: "Location to search for restaurants (e.g., \"Mission District SF\", \"Downtown Portland\"). If omitted, location will be auto-detected."
},
dietaryRestrictions: {
type: "array",
items: {
type: "string"
},
default: [
"gluten-free",
"dairy-free",
"pescatarian"
],
description: "List of dietary restrictions (e.g., [\"gluten-free\", \"dairy-free\", \"pescatarian\"])"
}
}
},
prompt: {
type: "string",
description: "Additional context or preferences for restaurant search (optional)"
}
},
includeMessageHistory: true,
outputMode: "last_message",
spawnerPrompt: `Spawn when you need to find nearby restaurants`,
systemPrompt: ``,
instructionsPrompt: `
Use the Exa MCP to help me find restaurants that meet the specified dietary restrictions within 1 mile of the specified location.
The dietary restrictions are provided in params.dietaryRestrictions as an array of strings (e.g., ["gluten-free", "dairy-free", "pescatarian"]).
For each candidate restaurant, spawn a research-restaurant agent and pass the dietary restrictions to it. Show the results of all of these agents.
`,
stepPrompt: ``,
handleSteps: function* ({ params, logger }) {
let location = params?.location;
if (!location) {
logger.info("No location provided \u2014 detecting via IP geolocation");
const geoProviders = [
{ url: "https://ipapi.co/json/", parse: (d) => d.city ? [d.city, d.region_code].filter(Boolean).join(", ") : null },
{ url: "https://ipinfo.io/json", parse: (d) => d.city ? [d.city, d.region].filter(Boolean).join(", ") : null },
{ url: "https://ip-api.com/json", parse: (d) => d.city ? [d.city, d.region].filter(Boolean).join(", ") : null }
];
for (const provider of geoProviders) {
const { toolResult } = yield {
toolName: "run_terminal_command",
input: { command: `curl -s ${provider.url}`, timeout_seconds: 10 }
};
if (toolResult?.[0]?.type === "json")
try {
const geo = JSON.parse(toolResult[0].value.stdout ?? ""), detected = provider.parse(geo);
if (detected) {
location = detected;
logger.info(`Detected location via ${provider.url}: ${location}`);
break;
}
} catch {}
}
}
const restrictions = params?.dietaryRestrictions ?? [];
yield {
toolName: "add_message",
input: {
role: "user",
content: location ? `Find restaurants near "${location}" with dietary restrictions: ${JSON.stringify(restrictions)}` : `Could not auto-detect location. Dietary restrictions: ${JSON.stringify(restrictions)}. Please ask the user for their location before searching.`
}
};
yield "STEP_ALL";
},
mcpServers: {
exa: {
url: "https://mcp.exa.ai/mcp?",
type: "http",
params: {},
headers: {}
}
},
inheritParentSystemPrompt: false
}