Skip to main content
Glama

alloc

Reserve Slurm resources and open a persistent compute-node shell in tmux, auto-selecting GPU or CPU and keeping the session alive after disconnect.

Instructions

抢占资源并直接执行(绝不只返回命令):tmux 内 salloc + srun bash, 分配后 attach 即入计算节点 shell,断线不丢资源。

抢占选择自动完成(无需先查询):resource 缺省 = GPU 优先、无空闲 GPU 回退 CPU; resource=gpu / cpu 只抢该类(无则失败并附当前余量摘要); partition 显式指定则直接使用。返回 granted/pending/failed 与 job_id/node。

Args: connection: cluster 连接 label purpose: 会话用途名(如 train-a100),用于 tmux 命名与检索 resource: gpu | cpu;缺省为自动(GPU 优先回退 CPU) gpus: GPU 卡数(默认 1;resource 含 gpu 时生效) cpus: CPU 核数(cpu 资源必给则默认 4;也可与 GPU 同时指定) partition: 显式分区(跳过自动选择) wait: 等待授予秒数(超时会话保留,session_info 随时查)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
cpusNo
gpusNo
waitNo
purposeNoalloc
resourceNo
partitionNo
connectionYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.8/5.0
Behavior5/5

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

Annotations only declare readOnlyHint=false and destructiveHint=false. The description goes well beyond that by disclosing that allocation happens inside tmux, that attach enters a compute-node shell, that disconnection does not lose resources, that wait timeout preserves the session, and that return statuses are granted/pending/failed with job_id/node. These are exactly the behavioral traits an agent needs to invoke the tool correctly.

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

Conciseness5/5

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

The description is front-loaded with the core purpose and then structured into automatic allocation logic, return behavior, and an Args list. Despite being detailed, every sentence earns its place by explaining semantics needed for a 7-parameter tool with no schema descriptions. It is appropriately sized for the complexity.

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?

Given the complexity and the 7-parameter schema with 0% description coverage, the definition is complete. It covers purpose, allocation behavior, return statuses, and all parameters, and an output schema exists so return-value details need not be fully expanded. Nothing critical for correct invocation appears missing.

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?

Schema description coverage is 0%, so the description carries the full burden. It documents all 7 parameters in the Args list, including connection meaning, purpose naming, resource enum behavior, default gpus/cpus, partition override, and wait semantics. This fully compensates for the schema's lack of parameter 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 states a specific verb and resource: it allocates/preempts resources and directly executes, using tmux, salloc, and srun bash. It distinguishes itself from a command-only tool by saying '绝不只返回命令' and clarifies that attach enters a compute-node shell with persistent resources. This gives an agent enough to identify what alloc does versus siblings like exec or submit.

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

Usage Guidelines4/5

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

The description gives clear operational context: allocation selection is automatic ('无需先查询'), resource defaults are explained, and partition overrides are described. However, it does not explicitly name alternatives or state when not to use this tool versus exec, submit, or session_list. The guidance is strong for parameter behavior but lacks direct sibling routing.

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