agentbay_brain_setup
Set up a knowledge brain for your AI agent with one API call. Provide agent name, description, framework, and model to receive project ID, agent ID, and connection configs.
Instructions
Create a Knowledge Brain for your agent in one call. Returns project ID, agent ID, and all configs needed to connect.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | Agent name (e.g., "Moonsa", "my-agent") | |
| description | No | Brain description | |
| framework | No | Agent framework (openclaw, langchain, crewai, custom) | |
| model | No | Primary model the agent uses |
Implementation Reference
- src/index.ts:976-994 (handler)The handler function for agentbay_brain_setup tool. It calls the /api/v1/brain/setup endpoint with name, description, framework, and model parameters, then returns project ID, agent ID, brain slug, and OpenClaw config if available.
async ({ name: brainName, description: brainDesc, framework: fw, model: mdl }) => { const data = await apiPost('/api/v1/brain/setup', { name: brainName, description: brainDesc, framework: fw, model: mdl, }); if (data.error) return { content: [{ type: 'text' as const, text: `Error: ${data.error}` }] }; let text = `Knowledge Brain created!\n\nProject ID: ${data.projectId}\nAgent ID: ${data.agentId}\nSlug: ${data.brainSlug}`; if (data.openclawConfig) { if (data.openclawConfig.claudeCommand) text += `\n\nOpenClaw setup:\n${data.openclawConfig.claudeCommand}`; if (data.openclawConfig.soulMdAddition) text += `\n\nSOUL.md addition:\n${data.openclawConfig.soulMdAddition}`; if (data.openclawConfig.bootstrapMd) text += `\n\nBOOTSTRAP.md:\n${data.openclawConfig.bootstrapMd}`; } text += `\n\nNext: Import knowledge with agentbay_brain_import`; return { content: [{ type: 'text' as const, text }] }; } ); - src/index.ts:970-975 (schema)Input schema for agentbay_brain_setup using Zod. Accepts: name (string, required), description (optional string), framework (optional string), model (optional string).
{ name: z.string().describe('Agent name (e.g., "Moonsa", "my-agent")'), description: z.string().optional().describe('Brain description'), framework: z.string().optional().describe('Agent framework (openclaw, langchain, crewai, custom)'), model: z.string().optional().describe('Primary model the agent uses'), }, - src/index.ts:967-994 (registration)Registration of the 'agentbay_brain_setup' tool on the MCP server via server.tool(), with its description, schema, and handler function.
server.tool( 'agentbay_brain_setup', 'Create a Knowledge Brain for your agent in one call. Returns project ID, agent ID, and all configs needed to connect.', { name: z.string().describe('Agent name (e.g., "Moonsa", "my-agent")'), description: z.string().optional().describe('Brain description'), framework: z.string().optional().describe('Agent framework (openclaw, langchain, crewai, custom)'), model: z.string().optional().describe('Primary model the agent uses'), }, async ({ name: brainName, description: brainDesc, framework: fw, model: mdl }) => { const data = await apiPost('/api/v1/brain/setup', { name: brainName, description: brainDesc, framework: fw, model: mdl, }); if (data.error) return { content: [{ type: 'text' as const, text: `Error: ${data.error}` }] }; let text = `Knowledge Brain created!\n\nProject ID: ${data.projectId}\nAgent ID: ${data.agentId}\nSlug: ${data.brainSlug}`; if (data.openclawConfig) { if (data.openclawConfig.claudeCommand) text += `\n\nOpenClaw setup:\n${data.openclawConfig.claudeCommand}`; if (data.openclawConfig.soulMdAddition) text += `\n\nSOUL.md addition:\n${data.openclawConfig.soulMdAddition}`; if (data.openclawConfig.bootstrapMd) text += `\n\nBOOTSTRAP.md:\n${data.openclawConfig.bootstrapMd}`; } text += `\n\nNext: Import knowledge with agentbay_brain_import`; return { content: [{ type: 'text' as const, text }] }; } ); - src/index.ts:947-964 (helper)Related tool 'agentbay_agent_register' (alias) which also calls /api/v1/brain/setup but with a slightly different parameter set (no model), using a simpler response format.
server.tool( 'agentbay_agent_register', 'Register this agent with AgentBay. Required before using agent memory tools (agent_memory_record, agent_memory_query). Creates a Knowledge Brain and links it to your API key.', { name: z.string().describe('Agent name (e.g., "codex", "my-agent")'), description: z.string().optional().describe('Agent description'), framework: z.string().optional().describe('Agent framework (codex, openclaw, langchain, crewai, custom)'), }, async ({ name: brainName, description: brainDesc, framework: fw }) => { const data = await apiPost('/api/v1/brain/setup', { name: brainName, description: brainDesc, framework: fw, }); if (data.error) return { content: [{ type: 'text' as const, text: `Error: ${data.error}` }] }; return { content: [{ type: 'text' as const, text: `Agent registered!\n\nAgent ID: ${data.agentId}\nProject ID: ${data.projectId}\n\nYou can now use agentbay_agent_memory_record and agentbay_agent_memory_query.` }] }; } );