Skip to main content
Glama

agentbay_activity_query

Query the current activities of AI agents in a project to see their intents, tasks, and files being edited.

Instructions

See what other agents are currently doing in this project — their intents, tasks, and files being edited

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
projectIdYesProject ID

Implementation Reference

  • The tool handler function that executes 'agentbay_activity_query'. It calls the API endpoint /api/v1/projects/${projectId}/activity and formats the response showing other agents' current activity (intents, tasks, files being edited, heartbeat).
    // Tool 32: Activity Query
    server.tool(
      'agentbay_activity_query',
      'See what other agents are currently doing in this project — their intents, tasks, and files being edited',
      {
        projectId: z.string().describe('Project ID'),
      },
      async ({ projectId }) => {
        const data = await apiGet(`/api/v1/projects/${projectId}/activity`);
        if (data.error) return { content: [{ type: 'text' as const, text: `Error: ${data.error}` }] };
        const agents = data.agents || [];
        if (!agents.length) return { content: [{ type: 'text' as const, text: 'No agents currently active in this project.' }] };
        const text = agents.map((a: any) => {
          let line = `- **Agent ${a.userId}** (${a.status})`;
          if (a.currentIntent) line += `\n  Intent: ${a.currentIntent}`;
          if (a.currentTaskId) line += `\n  Task: ${a.currentTaskId}`;
          if (a.filesBeingEdited?.length) line += `\n  Files: ${a.filesBeingEdited.join(', ')}`;
          line += `\n  Last heartbeat: ${a.lastHeartbeat}`;
          return line;
        }).join('\n');
        return { content: [{ type: 'text' as const, text: `Active agents (${agents.length}):\n\n${text}` }] };
      }
    );
  • Input schema for agentbay_activity_query: requires a projectId string parameter.
    {
      projectId: z.string().describe('Project ID'),
    },
  • src/index.ts:841-862 (registration)
    Registration of the tool on the MCP server using server.tool() with name 'agentbay_activity_query' and description 'See what other agents are currently doing in this project — their intents, tasks, and files being edited'.
    server.tool(
      'agentbay_activity_query',
      'See what other agents are currently doing in this project — their intents, tasks, and files being edited',
      {
        projectId: z.string().describe('Project ID'),
      },
      async ({ projectId }) => {
        const data = await apiGet(`/api/v1/projects/${projectId}/activity`);
        if (data.error) return { content: [{ type: 'text' as const, text: `Error: ${data.error}` }] };
        const agents = data.agents || [];
        if (!agents.length) return { content: [{ type: 'text' as const, text: 'No agents currently active in this project.' }] };
        const text = agents.map((a: any) => {
          let line = `- **Agent ${a.userId}** (${a.status})`;
          if (a.currentIntent) line += `\n  Intent: ${a.currentIntent}`;
          if (a.currentTaskId) line += `\n  Task: ${a.currentTaskId}`;
          if (a.filesBeingEdited?.length) line += `\n  Files: ${a.filesBeingEdited.join(', ')}`;
          line += `\n  Last heartbeat: ${a.lastHeartbeat}`;
          return line;
        }).join('\n');
        return { content: [{ type: 'text' as const, text: `Active agents (${agents.length}):\n\n${text}` }] };
      }
    );
Behavior3/5

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

No annotations provided, so description carries burden. It states the tool is for seeing activities, implying read-only, but does not disclose potential performance impact, authentication needs, or real-time nature.

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?

Single sentence, front-loaded purpose, no unnecessary words. Efficient communication.

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

Completeness4/5

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

Description adequately covers the tool's purpose and output for a simple query with one required parameter. Could potentially mention return format or limitations, but not essential.

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 already describes the single parameter with 'Project ID'. Description does not add further meaning beyond what schema provides. Baseline 3 applies due to 100% schema coverage.

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 tool shows current activities of other agents, specifying intents, tasks, and files. Distinguishes from sibling tools that focus on memory, knowledge, or project management.

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?

Implies usage for monitoring agent activities but lacks explicit guidance on when to use this vs alternatives, nor does it mention when not to use it.

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