Skip to main content
Glama

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

TableJSON Schema
NameRequiredDescriptionDefault
nameYesAgent name (e.g., "Moonsa", "my-agent")
descriptionNoBrain description
frameworkNoAgent framework (openclaw, langchain, crewai, custom)
modelNoPrimary model the agent uses

Implementation Reference

  • 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 }] };
      }
    );
  • 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 }] };
      }
    );
  • 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.` }] };
      }
    );
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description should disclose behavioral traits like side effects or permissions. It only mentions returns, not whether creation is idempotent, what happens on duplicates, or if it requires authentication. This is insufficient.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Single sentence that is clear and to the point. However, it could be slightly more informative without being verbose. Still, it is well-structured and front-loaded.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Without annotations or output schema, the description should provide more context about what a 'Knowledge Brain' is, the expected impact, and the structure of returned data. Currently too minimal for a setup tool with 4 parameters.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100% so parameters are described in schema. The description adds no extra meaning beyond the schema's parameter descriptions. Baseline 3 is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

Description clearly states the action 'Create a Knowledge Brain', specifies it is for an agent, and indicates the return of IDs and configs. It distinguishes from sibling 'agentbay_brain_import' which suggests importing existing brains.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance on when to use this tool versus alternatives like 'agentbay_brain_import' or other knowledge tools. The description only says 'in one call' but lacks context for appropriate usage.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/thomasjumper/agentbay-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server