Skip to main content
Glama

cg_check

Parse and type-check C⏚ source code to detect errors before simulation. Fix all reported diagnostics in your draft to ensure correct hardware design.

Instructions

Parse, scope, and type-check C⏚ source without running it. Returns {ok, diagnostics:[{file,line,message}], summary}. Call this first on any draft; fix every diagnostic before simulating. extra_files maps filename → content for imported bundles/tasks (e.g. {"Defs.cg": "..."}). For a MULTI-FILE project, pass package_dir (the folder holding your .cg files, e.g. "fpga/src/main/cg", relative to the project root): the tool then reads every sibling .cg there, so tasks defined in other files of the same package resolve — just like the IDE. A task you only got from cg_example is text; it must be saved to a file in that dir to resolve.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sourceYes
extra_filesNo
package_dirNo
Behavior4/5

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

Discloses read-only behavior, return format (ok, diagnostics, summary), and parameter effects. No annotations exist, so description bears full burden. Does not mention performance or rate limits, but sufficient for static analysis tool.

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

Conciseness4/5

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

Single paragraph packs essential information. Front-loads purpose. Slightly dense but no wasted words. Could benefit from structured formatting for readability, but overall concise.

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?

Handles both simple and multi-file usage, explains return format, and warns about tasks from cg_example needing file storage. No output schema exists, but description covers everything needed for correct invocation.

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 has 0% description coverage, but description compensates fully: explains source is required, extra_files maps filename to content for imports, and package_dir is relative project folder for multi-file projects. Adds crucial context beyond schema.

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?

Clearly states the tool parses, scopes, and type-checks source without running it, distinguishing it from siblings like cg_simulate (execution) and cg_suggest_for_error (error-specific). Includes return format and usage context.

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?

Explicitly advises calling this first on any draft and fixing diagnostics before simulating. Explains when to use extra_files and package_dir. Lacks explicit exclusions but context is clear given sibling tools.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Neosyn-Logic/cg-agent-kit'

If you have feedback or need assistance with the MCP directory API, please join our Discord server