from parallel import Parallel
from parallel.types.beta import McpServerParam
from parallel.types.beta.beta_run_input_param import BetaRunInputParam
client = Parallel(api_key="API Key")
group_status = client.beta.task_group.add_runs(
"taskgroup_id",
inputs=[
BetaRunInputParam(
input="What was the GDP of France in 2023?",
processor="base",
mcp_servers=[McpServerParam(
type="url",
name="parallel_web_search",
url="https://mcp.parallel.ai/v1beta/search_mcp",
headers={"x-api-key": "API Key"}
)]
)
],
betas=["mcp-server-2025-07-17"]
)
print(group_status.status){
"status": {
"num_task_runs": 123,
"task_run_status_counts": {},
"is_active": true,
"status_message": "<string>",
"modified_at": "2025-04-24T18:56:22.513132Z"
},
"run_ids": [
"<string>"
],
"run_cursor": "<string>",
"event_cursor": "<string>"
}Initiates multiple task runs within a TaskGroup.
from parallel import Parallel
from parallel.types.beta import McpServerParam
from parallel.types.beta.beta_run_input_param import BetaRunInputParam
client = Parallel(api_key="API Key")
group_status = client.beta.task_group.add_runs(
"taskgroup_id",
inputs=[
BetaRunInputParam(
input="What was the GDP of France in 2023?",
processor="base",
mcp_servers=[McpServerParam(
type="url",
name="parallel_web_search",
url="https://mcp.parallel.ai/v1beta/search_mcp",
headers={"x-api-key": "API Key"}
)]
)
],
betas=["mcp-server-2025-07-17"]
)
print(group_status.status){
"status": {
"num_task_runs": 123,
"task_run_status_counts": {},
"is_active": true,
"status_message": "<string>",
"modified_at": "2025-04-24T18:56:22.513132Z"
},
"run_ids": [
"<string>"
],
"run_cursor": "<string>",
"event_cursor": "<string>"
}Request to initiate new task runs in a task group.
List of task runs to execute.
Show child attributes
Processor to use for the task.
Input to the task, either text or a JSON object.
"What was the GDP of France in 2023?"
Optional source policy governing preferred and disallowed domains in web search results.
Show child attributes
List of domains to restrict the results to. If specified, only sources from these domains will be included. Accepts plain domains (e.g., example.com, subdomain.example.gov) or bare domain extension starting with a period (e.g., .gov, .edu, .co.uk).
List of domains to exclude from results. If specified, sources from these domains will be excluded. Accepts plain domains (e.g., example.com, subdomain.example.gov) or bare domain extension starting with a period (e.g., .gov, .edu, .co.uk).
Task specification. If unspecified, defaults to auto output schema.
Show child attributes
JSON schema or text fully describing the desired output from the task. Descriptions of output fields will determine the form and content of the response. A bare string is equivalent to a text schema with the same description.
Optional JSON schema or text description of expected input to the task. A bare string is equivalent to a text schema with the same description.
Optional list of MCP servers to use for the run.
To enable this feature in your requests, specify mcp-server-2025-07-17 as one of the values in parallel-beta header (for API calls) or betas param (for the SDKs).
Show child attributes
URL of the MCP server.
Name of the MCP server.
Type of MCP server being configured. Always url.
"url"List of allowed tools for the MCP server.
Controls tracking of task run execution progress. When set to true, progress events are recorded and can be accessed via the Task Run events endpoint. When false, no progress events are tracked. Note that progress tracking cannot be enabled after a run has been created. The flag is set to true by default for premium processors (pro and above).
To enable this feature in your requests, specify events-sse-2025-07-24 as one of the values in parallel-beta header (for API calls) or betas param (for the SDKs).
Callback URL (webhook endpoint) that will receive an HTTP POST when the run completes.
This feature is not available via the Python SDK. To enable this feature in your API requests, specify the parallel-beta header with webhook-2025-08-12 value.
Default task spec to use for the runs. If task_spec is specified in a run, it overrides this default.
Show child attributes
JSON schema or text fully describing the desired output from the task. Descriptions of output fields will determine the form and content of the response. A bare string is equivalent to a text schema with the same description.
Optional JSON schema or text description of expected input to the task. A bare string is equivalent to a text schema with the same description.
Successful Response
Response from adding new task runs to a task group.
Status of the group.
Show child attributes
Number of task runs in the group.
True if at least one run in the group is currently active, i.e. status is one of {'cancelling', 'queued', 'running'}.
Human-readable status message for the group.
Timestamp of the last status update to the group, as an RFC 3339 string.
"2025-04-24T18:56:22.513132Z"
IDs of the newly created runs.
Cursor for these runs in the run stream at taskgroup/runs?last_event_id=<run_cursor>. Empty for the first runs in the group.
Cursor for these runs in the event stream at taskgroup/events?last_event_id=<event_cursor>. Empty for the first runs in the group.