Skip to main content
Glama

agentbay_agent_register

Register an agent with AgentBay to create a Knowledge Brain linked to your API key. Required before using agent memory tools for storing, recalling, and sharing knowledge across sessions.

Instructions

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.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYesAgent name (e.g., "codex", "my-agent")
descriptionNoAgent description
frameworkNoAgent framework (codex, openclaw, langchain, crewai, custom)

Implementation Reference

  • The 'agentbay_agent_register' tool handler function registered via server.tool(). It calls POST /api/v1/brain/setup with name, description, and framework to register the agent with AgentBay.
    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.` }] };
      }
    );
  • The Zod schema for agentbay_agent_register: accepts 'name' (string, required), 'description' (string, optional), and 'framework' (string, optional).
    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.` }] };
      }
    );
  • src/index.ts:947-964 (registration)
    Registration of the tool with MCP server using server.tool() with name 'agentbay_agent_register' on line 947.
    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.` }] };
      }
    );
  • Reference to agentbay_agent_register in error message: 'No agent linked to this API key. Use agentbay_agent_register first.' in the agent_memory_record tool.
    if (!agentId) return { content: [{ type: 'text' as const, text: 'Error: No agent linked to this API key. Use agentbay_agent_register first.' }] };
  • Reference to agentbay_agent_register in error message: 'No agent linked to this API key. Use agentbay_agent_register first.' in the agent_memory_query tool.
    if (!agentId) return { content: [{ type: 'text' as const, text: 'Error: No agent linked to this API key. Use agentbay_agent_register first.' }] };
Behavior3/5

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

With no annotations, description carries full burden. It reveals that it 'Creates a Knowledge Brain and links it to your API key', which is a key side effect. However, it does not disclose idempotency, failure behavior, or authorization requirements.

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

Conciseness5/5

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

Two sentences, no wasted words. Front-loaded with the primary action, then important context about prerequisites and side effects.

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

Completeness3/5

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

Provides sufficient context for a registration tool with 3 parameters, including prerequisite relationship. However, it lacks explanation of return value or error states, and no output schema exists to compensate.

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 already documented in schema. Description adds no additional meaning beyond the schema definitions. Baseline score of 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 verb 'register' with resource 'agent with AgentBay'. It differentiates from sibling tools by indicating it's a prerequisite for memory tools, making its purpose distinct.

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

Usage Guidelines5/5

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

Explicitly states it is 'Required before using agent memory tools' and names specific sibling tools (agent_memory_record, agent_memory_query), providing clear when-to-use guidance and alternatives.

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