Skip to main content
Glama

agentbay_agent_memory_grant

Authorize another AI agent to read or write to your memory by specifying the agent ID and permission level. Share knowledge securely across sessions.

Instructions

Grant another agent read or write access to your agent memory

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
targetAgentIdYesAgent ID to grant access to
permissionYesPermission level

Implementation Reference

  • The handler function for the 'agentbay_agent_memory_grant' tool. It resolves the calling agent's ID via GET /api/v1/me, then POSTs to /api/v1/agents/{agentId}/memory/permissions with the targetAgentId and permission to grant another agent read or write access to the calling agent's memory.
    server.tool(
      'agentbay_agent_memory_grant',
      'Grant another agent read or write access to your agent memory',
      {
        targetAgentId: z.string().describe('Agent ID to grant access to'),
        permission: z.enum(['read', 'write']).describe('Permission level'),
      },
      async ({ targetAgentId, permission }) => {
        const meData = await apiGet('/api/v1/me');
        if (!meData.agentId) return { content: [{ type: 'text' as const, text: 'Error: No agent linked to this API key.' }] };
    
        const data = await apiPost(`/api/v1/agents/${meData.agentId}/memory/permissions`, { targetAgentId, permission });
        if (data.error) return { content: [{ type: 'text' as const, text: `Error: ${data.error}` }] };
        return { content: [{ type: 'text' as const, text: data.message || `Granted ${permission} access.` }] };
      }
    );
  • Input schema for 'agentbay_agent_memory_grant': requires targetAgentId (string) and permission (enum 'read' or 'write').
    // Tool 21: Agent Memory Grant
    server.tool(
      'agentbay_agent_memory_grant',
      'Grant another agent read or write access to your agent memory',
      {
        targetAgentId: z.string().describe('Agent ID to grant access to'),
        permission: z.enum(['read', 'write']).describe('Permission level'),
      },
  • src/index.ts:483-499 (registration)
    Registration of the 'agentbay_agent_memory_grant' tool via server.tool() with the name, description, schema, and handler. Registered as 'Tool 21: Agent Memory Grant'.
    // Tool 21: Agent Memory Grant
    server.tool(
      'agentbay_agent_memory_grant',
      'Grant another agent read or write access to your agent memory',
      {
        targetAgentId: z.string().describe('Agent ID to grant access to'),
        permission: z.enum(['read', 'write']).describe('Permission level'),
      },
      async ({ targetAgentId, permission }) => {
        const meData = await apiGet('/api/v1/me');
        if (!meData.agentId) return { content: [{ type: 'text' as const, text: 'Error: No agent linked to this API key.' }] };
    
        const data = await apiPost(`/api/v1/agents/${meData.agentId}/memory/permissions`, { targetAgentId, permission });
        if (data.error) return { content: [{ type: 'text' as const, text: `Error: ${data.error}` }] };
        return { content: [{ type: 'text' as const, text: data.message || `Granted ${permission} access.` }] };
      }
    );
Behavior2/5

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

No annotations are provided, so the description carries the full burden. It states the action but does not disclose whether granting overwrites existing permissions, is idempotent, or requires any special authority. This lacks important behavioral context for an agent to invoke correctly.

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?

The description is a single, efficient sentence that conveys the core purpose without any wasted words. It is front-loaded and easy to parse.

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?

For a simple tool with two parameters and no output schema, the description is adequate for basic understanding. However, it lacks details about behavioral nuances (e.g., whether granting is additive or replaceable), which would be helpful for an AI agent's correct invocation.

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%, and both parameters have clear descriptions. The tool description does not add any extra meaning beyond the schema, so it meets the baseline expectation without providing additional semantic value.

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?

The description clearly states the verb 'Grant' and identifies the resource 'another agent' and the scope 'read or write access to your agent memory'. It unambiguously distinguishes this tool from siblings like agentbay_agent_memory_revoke or agentbay_agent_memory_query.

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

Usage Guidelines3/5

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

The description implies the tool is used to grant permissions, but it offers no explicit guidance on when to use it versus alternatives (e.g., revoke) or any prerequisites (e.g., being the owner of the memory). The usage context is only implied.

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