Skip to main content
Glama

validate_cs_script

Read-onlyIdempotent

Type-check cs_script code with the TypeScript compiler against Valve’s point_script.d.ts to catch unknown APIs and type-narrowing issues before shipping.

Instructions

Type-check a cs_script with the TypeScript compiler against this build's Valve point_script.d.ts. Errors with category unknown_api mean the method/property does not exist — fix before shipping. needs_type_narrowing gives the subclass to cast to. ALWAYS run this before handing a script to the user.

Input Schema

NameRequiredDescriptionDefault
codeNoJavaScript source to check
gameNoGame id: one of cs2, deadlockcs2
pathNoPath of the .js file inside the addon
addonNoOr: addon whose file to check

Output Schema

NameRequiredDescriptionDefault
okYesTrue when there are no errors (warnings/info allowed)
errorsYes
checkerYes
warningsYes
diagnosticsYes
instance_methods_usedNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.2/5.0
Behavior4/5

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

Annotations already declare readOnly/idempotent/closed-world, so the description uses its space well by explaining diagnostic semantics: what `unknown_api` and `needs_type_narrowing` mean and what to do about each. It does not describe the overall result shape or whether all errors are returned at once, leaving a gap, but the added error-category context is genuinely beyond structured fields.

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?

Three sentences, front-loaded with the core action, then the error-code gloss, then the workflow mandate. No filler and nothing repeated from annotations.

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?

With an output schema present, the description needn't explain return values, and it covers action, error interpretation, and workflow timing. The main omission is guidance on the code-vs-path/addon input modes, which an agent must still infer.

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 coverage is 100%, so the individual parameters are documented by the schema. However, the schema shows two competing input modes (`code` vs `path`/`addon`) with no mutual-exclusivity rule, and the description says nothing to disambiguate them or to explain the `game` default; baseline 3.

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?

States a precise verb and resource: type-check a cs_script with the TypeScript compiler against this build's point_script.d.ts. That is specific enough to separate it from validate_cfg and from read-only lookups like get_script_api or list_script_types.

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?

"ALWAYS run this before handing a script to the user" gives an explicit trigger condition in the authoring workflow, which is the key usage decision. It stops short of naming alternatives or when-not-to-use cases, so it is clear context without full routing.

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