Skip to main content
Glama

check

Detects CUDA/HIP bugs without a GPU by rerunning kernels in varied thread orders and under sanitizers to find missing __syncthreads(), races, uninitialized reads, and leaks at source lines.

Instructions

Look for bugs in a CUDA or HIP program without a GPU. Runs it with the threads of each block in several orders (forward, reverse, random with several seeds, warp orders): a result that changes with the order means a missing __syncthreads() or __syncwarp(), or a race. Also reports cuda4cpu's checks (divergent barriers and warp operations, copies in the wrong direction, allocations never freed), runs with new allocations filled with 0xff bytes (a changed result means reads of memory never written; when the output varies, it runs with 0xff bytes and with zeros twice each, and a result that each fill makes steady but the two make different means the same), and runs a build with AddressSanitizer and UBSan (out-of-bounds and use-after-free accesses, undefined behavior), with source lines. The program should check its own results or print them; output that varies between identical runs (timings) is compared by exit code only, unless ignore_patterns removes the lines that vary.

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": "check"
  }
}

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
seedsNoSeeds of the random orders (default 1, 2, 3)
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)
sanitizersNoAlso run with AddressSanitizer and UBSan (default true)
environmentNoMore environment variables for the program
ignore_patternsNoRegular expressions of output lines to leave out of the comparison between orders, such as timings
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

A4.2/5.0
Behavior4/5

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

With no annotations, the description carries the full behavioral burden and does it well: it describes the order-permutation strategy, the 0xff/zero fill comparison logic, sanitizer runs with source lines, and exit-code-only comparison for nondeterministic output. What it omits is cost and scale (how many runs a single call triggers) and any hint of what the report of findings looks like.

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?

It is a single dense paragraph with the purpose correctly front-loaded, but the middle clauses are run-on and hard to parse, especially 'a result that each fill makes steady but the two make different means the same'. Some of the fill-pattern logic could be compressed without losing meaning.

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 12-parameter tool with no output schema, this is close to complete: it covers compilation, execution orders, memory-fill checks, sanitizers and output comparison semantics. It would be stronger with a note on how many runs occur and roughly how long a call takes.

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

Parameters4/5

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

Schema coverage is 100%, so the baseline is 3. The description still adds meaning: it explains what seeds control (order permutations), what ignore_patterns accomplishes (excluding varying lines so comparison falls back to exit code), and what the file/path inputs are for. That is value beyond the schema wording.

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 opens with a specific verb and resource: 'Look for bugs in a CUDA or HIP program without a GPU'. That distinguishes it cleanly from siblings like compile, run and test_kernel, and an agent can identify the tool from the first sentence alone.

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?

It explains the testing context (no GPU available, program should check its own results) and states what the tool assumes about the program. It never explicitly names an alternative such as run or compile or states when not to use this tool, so the guidance is clear but not exhaustive.

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