Skip to main content
Glama

set_affinity

Idempotent

Set the logical processors a process may run on by assigning a CPU list, enabling workload isolation and CPU load management.

Instructions

Sets which logical processors a process may run on (its affinity).

Input Schema

NameRequiredDescriptionDefault
pidYes
cpusYesThe logical processors it may run on, from 0 (get_cpu lists them).
forceNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

C2.6/5.0
Behavior2/5

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

Annotations already declare readOnlyHint=false, idempotentHint=true, and destructiveHint=false, so the safety profile is covered. The description adds only a definition of affinity — nothing about whether the change takes effect on already-running threads, whether elevation or process ownership is required, or what happens on invalid CPU indices.

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

Conciseness3/5

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

A single clean, front-loaded sentence with zero filler, but it is undersized for the job: the space saved is space the agent needed for the 'force' parameter and usage conditions.

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

Completeness2/5

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

For a 3-parameter mutation tool with low schema coverage, no output schema, and an undocumented 'force' flag, the description should carry more weight. It leaves the agent guessing about prerequisites and the effect of the optional parameter.

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

Parameters2/5

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

Schema description coverage is only 33%: only 'cpus' is documented in the schema, while 'pid' and especially 'force' are bare. The description does not compensate at all — the meaning of 'force' (force past permissions? force termination of threads?) is nowhere explained, which is a real ambiguity for a mutation call.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a concrete verb and resource: 'Sets which logical processors a process may run on (its affinity).' The parenthetical clarifies the technical term, so an agent can distinguish it from set_priority or limit_process without opening the schema. It stops short of explicitly naming the nearest sibling (set_priority) as an alternative.

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

Usage Guidelines2/5

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

No when-to-use or when-not-to-use guidance is given. There is no mention that get_cpu or get_process should be consulted first, no note about required privileges per process, and no pointer to set_priority for the closely related scheduling concern.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.