Skip to main content
Glama
natl-set

ANTLR4 MCP Server

by natl-set

remove-rule

Remove an ANTLR4 grammar rule cleanly to delete obsolete or unused definitions. Use for refactoring grammar structure, but check rule usages first since references aren't updated.

Instructions

Remove a rule cleanly from an ANTLR4 grammar.

When to use: Delete obsolete rules, clean up unused definitions, or refactor grammar structure.

Example usage: rule_name: "oldExpression" write_to_file: true

Warning: Does not update references to this rule in other rules. Use find-rule-usages first to check impact.

Returns: Modified grammar with rule removed, success message, file write confirmation if applicable.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
from_fileNoOptional: path to a grammar file to read. Required if using write_to_file.
rule_nameYesName of the rule to remove (case-sensitive)
write_to_fileNoIf true, writes modified grammar back to from_file (requires from_file to be set)
grammar_contentNoThe ANTLR4 grammar file content
Behavior4/5

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

With no annotations, the description carries the burden of disclosing side effects. It warns that 'Does not update references to this rule in other rules,' which is a critical behavioral trait. It also mentions the return value (modified grammar, success message, file write confirmation). However, it doesn't address edge cases like missing rule or error handling, so a 4 is appropriate.

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?

The description is well-structured and appropriately sized. It opens with a clear one-sentence summary, then uses compact sections (When to use, Example usage, Warning, Returns) that each add value without redundancy. Every sentence earns its place.

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?

Despite no output schema and no annotations, the description covers purpose, usage scenarios, a critical warning, an example, and return values. The 4-parameter tool is fully understandable for an agent to select and invoke correctly. The description is complete for its complexity.

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 parameters (rule_name, from_file, write_to_file, grammar_content) are already well-documented. The description adds a small example (rule_name: 'oldExpression', write_to_file: true) but no significant extra meaning beyond the schema. It does reinforce the dependency between write_to_file and from_file, but that is already in the 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?

The description clearly states the tool's purpose: 'Remove a rule cleanly from an ANTLR4 grammar.' The verb 'Remove' and specific resource 'rule from ANTLR4 grammar' make it unambiguous, and it is easily distinguished from sibling tools like rename-rule or update-rule.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicit 'When to use' section lists concrete scenarios: 'Delete obsolete rules, clean up unused definitions, or refactor grammar structure.' It also provides an exclusion/alternative: 'Does not update references... Use find-rule-usages first to check impact.' This gives clear guidance on appropriate use.

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/natl-set/antlr4-mcp'

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