Skip to main content
Glama

compile

Build CUDA or HIP sources as nvcc or hipcc would, returning success or failure, source-line diagnostics, and cuda4cpu features the sources use but do not support.

Instructions

Compile CUDA or HIP sources with cuda4cpu, as nvcc or hipcc would: whether they build, the compiler's diagnostics at the sources' own lines, and the features the sources use that cuda4cpu does not implement (textures, inline PTX, CUDA libraries, ...).

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

Input Schema

NameRequiredDescriptionDefault
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
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)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.6.0

TDQS

B3.3/5.0
Behavior3/5

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

No annotations are provided, so the description carries the full disclosure burden. It usefully explains that the tool reports build success, diagnostics mapped to source lines, and unsupported CUDA/HIP features, but it does not state whether compilation produces artifacts, whether it executes code, or what permissions/side effects are involved.

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?

It is a single front-loaded sentence that immediately says what the tool does and then enumerates the useful result categories. There is no filler or redundant wording.

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

Completeness3/5

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

The description covers the tool's purpose and the nature of its results, which is important because no output schema exists. However, with no annotations, it should say more about side effects, artifact generation, and safety, and it gives no routing guidance relative to sibling tools.

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 schema already documents files, paths, options, and language. The description adds contextual framing ('as nvcc or hipcc would') but does not add parameter-specific meaning beyond what the schema provides.

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?

The description states a specific verb and resource: 'Compile CUDA or HIP sources with cuda4cpu,' and names the likely outputs (build status, diagnostics, unsupported features). It does not explicitly distinguish this tool from siblings such as check, run, or test_kernel, so it falls short of a 5.

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?

There is no explicit when-to-use or when-not-to-use guidance, and no alternatives are named. 'As nvcc or hipcc would' describes compiler behavior rather than helping an agent choose between this and related tools like check or run.

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