Skip to main content
Glama

run

Compile and execute CUDA or HIP programs on the CPU, returning exit code, output, and cuda4cpu diagnostics for barrier and copy issues.

Instructions

Compile and run a CUDA or HIP program on the CPU: its exit code, output, and the problems cuda4cpu reports (divergent barriers, copies in the wrong direction). Use check to look for bugs.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "run"
  }
}

Input Schema

NameRequiredDescriptionDefault
argsNoThe program's arguments
filesNoSources by file name (relative paths) and their contents: .cu or .hip files, .cpp host files, and headers they include
pathsNoExisting source files to compile where they are
stdinNoInput for the program
optionsNoCompiler options, as nvcc's (-arch, -Xcompiler, -std, -I, -D, ...) or hipcc's; GPU options are accepted and ignored. Default -O2 -g.
languageNocuda (cuda4cpu-nvcc, the default) or hip (cuda4cpu-hipcc, the default when a source is a .hip file)
environmentNoMore environment variables for the program
timeout_secondsNoTime limit for each run (default 60, at most 600)
working_directoryNoWhere the program runs: by default, the directory of the last path given, or the directory of the inline files

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.6.0

TDQS

A3.8/5.0
Behavior3/5

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

With no annotations, the description carries the full burden, and it does disclose the non-obvious core behavior: execution is emulated on the CPU, GPU options are accepted and ignored is left to the schema, and it enumerates the diagnostic classes it reports (divergent barriers, wrong-direction copies). It does not say what happens when compilation fails, whether the program has I/O or network access, or that arbitrary user code is being executed.

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?

Two dense sentences, front-loaded with the action and the return payload, closing with the sibling routing hint. No filler or restatement of the name.

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

Completeness4/5

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

For a nine-parameter tool with nested objects and no output schema, the description usefully states what comes back (exit code, output, diagnostics) and flags the CPU-emulation model. Gaps remain around compile-failure behavior and mutual exclusivity of files versus paths, but the agent can call it correctly from description plus schema.

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

Parameters3/5

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

Schema description coverage is 100%, so the nine parameters, including the language enum, options, timeout, and working_directory defaults, are already documented in the schema. The description adds no parameter-level meaning beyond implying that exit code and output come back, so the baseline of 3 applies.

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?

Specific verb+resource: "Compile and run a CUDA or HIP program on the CPU," plus what it returns (exit code, output, cuda4cpu diagnostics). It explicitly separates itself from check, but says nothing about the sibling compile, which is the nearest alternative for build-only workflows.

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?

"Use check to look for bugs" names an alternative and the condition that selects it, which is genuine when-to-use guidance. It gives no exclusion relative to compile or any statement about when a build-only flow is preferable.

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

Deploy Server

Other Tools