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
| Name | Required | Description | Default |
|---|---|---|---|
| projectId | Yes | Project ID |
Implementation Reference
- src/index.ts:840-862 (handler)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}` }] }; } ); - src/index.ts:844-846 (schema)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}` }] }; } );