Skip to main content
Glama
IBM
by IBM

solve_assignment_problem

Assign tasks to agents while respecting capacity and skill constraints. Optimize for cost, maximum assignments, or balanced load.

Instructions

Solve a task assignment problem.

This is a high-level interface for assignment and matching problems. Use this instead of solve_constraint_model when you need to assign tasks to agents/workers with capacity and skill constraints.

Args: agents: List of agents available to perform tasks, each with: - id (str): Unique agent identifier - capacity (int, optional): Maximum number of tasks (default 1) - skills (list, optional): Skills this agent possesses - cost_multiplier (float, optional): Cost multiplier (default 1.0) - metadata (dict, optional): Additional context tasks: List of tasks to be assigned, each with: - id (str): Unique task identifier - required_skills (list, optional): Skills required for this task - duration (int, optional): Task duration/workload (default 1) - priority (int, optional): Task priority (default 1) - metadata (dict, optional): Additional context cost_matrix: Optional cost matrix where [i][j] = cost to assign task i to agent j. If not provided, uses agent.cost_multiplier * task.duration objective: Optimization goal - 'minimize_cost', 'maximize_assignments', or 'balance_load' force_assign_all: If True, all tasks must be assigned (infeasible if not possible). If False, some tasks can remain unassigned. max_time_ms: Maximum solver time in milliseconds (default 60000)

Returns: SolveAssignmentProblemResponse containing: - status: Solution status - assignments: List of task-to-agent assignments - unassigned_tasks: Tasks that could not be assigned - agent_load: Number of tasks assigned to each agent - total_cost: Total cost of all assignments - solve_time_ms: Actual solve time - optimality_gap: Gap from best bound - explanation: Human-readable summary

Tips for LLMs: - For task assignment: agents are workers/machines, tasks are jobs/work items - For matching: agents are resources, tasks are requests to match - Skills create hard constraints (incompatible if skills don't match) - Use minimize_cost for cost-optimal assignments - Use maximize_assignments when some tasks are optional - Use balance_load to distribute work evenly across agents

Example (Simple Assignment)::

response = await solve_assignment_problem(
    agents=[
        {"id": "worker_1", "capacity": 2, "cost_multiplier": 1.0},
        {"id": "worker_2", "capacity": 2, "cost_multiplier": 1.5},
    ],
    tasks=[
        {"id": "task_A", "duration": 3},
        {"id": "task_B", "duration": 2},
        {"id": "task_C", "duration": 1},
    ],
    objective="minimize_cost"
)
# Returns cost-optimal assignment respecting capacity

Example (With Skills)::

response = await solve_assignment_problem(
    agents=[
        {"id": "dev_1", "capacity": 3, "skills": ["python", "docker"]},
        {"id": "dev_2", "capacity": 2, "skills": ["python", "react"]},
    ],
    tasks=[
        {"id": "backend", "duration": 5, "required_skills": ["python", "docker"]},
        {"id": "frontend", "duration": 4, "required_skills": ["react"]},
    ],
    objective="minimize_cost"
)
# Only assigns tasks to agents with matching skills

Example (Balance Load)::

response = await solve_assignment_problem(
    agents=[
        {"id": "server_1", "capacity": 10},
        {"id": "server_2", "capacity": 10},
        {"id": "server_3", "capacity": 10},
    ],
    tasks=[
        {"id": f"job_{i}", "duration": 1} for i in range(15)
    ],
    objective="balance_load"
)
# Distributes tasks evenly across servers (5 per server)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
tasksYes
agentsYes
objectiveNominimize_cost
cost_matrixNo
max_time_msNo
force_assign_allNo
Behavior5/5

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

With no annotations, the description fully discloses behavioral traits: it describes the optimization behavior (minimize_cost, maximize_assignments, balance_load), hard constraints from skills, forced assignment behavior, default cost matrix logic, solver timeout, and return values. It also explains that skills create hard constraints and provides agent load distribution details.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is well-structured with clear sections (purpose, usage, args, returns, tips, examples). While lengthy, every sentence adds value and the information is front-loaded. It avoids redundancy but could be slightly more concise without losing effectiveness.

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

Completeness5/5

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

The description is complete for a complex tool: it covers parameter semantics, behavioral constraints, return values (including a structured response object), usage scenarios, and example code. No output schema exists, but the description compensates by listing response fields. It addresses potential edge cases (force_assign_all, unassigned tasks) and provides LLM tips.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Despite the schema description coverage being 0%, the description provides detailed explanations for all 6 parameters: agents, tasks, cost_matrix, objective, force_assign_all, max_time_ms. It includes default values, structure of nested objects, and examples that clarify usage. This adds significant meaning beyond the schema items' basic descriptions.

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 'Solve a task assignment problem' and distinguishes from sibling tools by specifying 'Use this instead of solve_constraint_model when you need to assign tasks to agents/workers with capacity and skill constraints.' It also mentions alternatives like solve_budget_allocation and solve_routing_problem implicitly through the sibling list.

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

Usage Guidelines5/5

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

The description provides explicit guidance on when to use this tool ('Use this instead of solve_constraint_model'), and includes context for LLMs with tips on assignment vs matching, skill constraints, and objective selection. It also gives examples demonstrating different scenarios (simple assignment, with skills, balance load), reinforcing usage guidelines.

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/IBM/chuk-mcp-solver'

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