validate_grammar
Validate a serialized GrammarSpec. Structural validation against the bundled grammar schema, an engine load in a fresh instance, and a check that every rule reference (p, r) names a rule the grammar actually defines — a dangling reference loads cleanly and then fails at parse time with unknown_rule. Returns {ok:true, v} (v = declared builtin config-schema version, absent means 1) or {ok:false, errors:[{path,message}]}. Security: a grammar carrying a ref key, or any function reference that is not a $-suffixed engine builtin, is rejected — validating a grammar never runs supplied code.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"grammar": "<grammar>"
},
"name": "validate_grammar"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| grammar | Yes | Serialized GrammarSpec (pure JSON, no functions). Schema: resource tabnas://schema/grammar. Grammars are validated before use; a `ref` key or a non-builtin function reference is rejected. |