Skip to main content
Glama

batch_prompt

Execute multiple CLI agent prompts in parallel using server-side asyncio, enabling concurrent task processing with controlled concurrency limits.

Instructions

Send multiple prompts to CLI runners in parallel (primary tool).

Fans out tasks server-side with asyncio.gather and a semaphore, enabling true parallel runner execution within a single MCP call. Single-task usage is perfectly valid — use prompt for convenience when sending one task.

Args: tasks: List of AgentTask objects, each with cli, prompt, and optional fields. max_concurrency: Max parallel runner invocations (default: 3). ctx: MCP context (auto-injected by FastMCP). None when called directly in tests.

Returns: MultiPromptResponse with results for each task.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
tasksYes
max_concurrencyNo

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/j7an/nexus-mcp'

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