Skip to main content
Glama
natl-set

ANTLR4 MCP Server

by natl-set

list-mode-rules

Lists all lexer rules in a specified ANTLR4 mode to inspect contents, debug issues, and understand mode structure.

Instructions

List all lexer rules in a specific mode.

When to use: Quick inspection of mode contents, debugging mode issues, understanding mode structure.

Returns:

  • List of rules with names, patterns, and line numbers

  • Total count of rules in the mode

Example - List rules in STRING_MODE: mode_name: "STRING_MODE"

Example - List rules in DEFAULT_MODE: mode_name: "DEFAULT_MODE"

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
from_fileNoOptional: path to a grammar file to read
mode_nameYesName of the mode to list rules from
grammar_contentNoThe ANTLR4 grammar file content
Behavior4/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It clearly explains the return format (list of rules with names, patterns, line numbers, and total count), which is essential. It does not discuss side effects, but for a read-only list operation this is adequate.

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 with clear sections, bullet points, and examples. Every sentence serves a purpose, and the examples are informative without being redundant. It is appropriately sized for the tool's complexity.

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?

Given the tool has only one required parameter, no output schema, and no annotations, the description covers the key aspects: purpose, when to use, return values, and usage examples. It does not address potential errors or the source of grammar content, but the schema covers those details. Overall, it is nearly complete.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so the baseline is 3. The description adds value by providing concrete examples for the mode_name parameter (e.g., 'STRING_MODE', 'DEFAULT_MODE'), which helps the agent understand acceptable values beyond the schema's generic name description.

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 function: 'List all lexer rules in a specific mode.' This is a specific verb+resource+scope combination that distinguishes it from sibling tools like list-rules, which likely lists rules globally rather than per mode.

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?

The description provides a 'When to use' section with concrete scenarios (quick inspection, debugging mode issues, understanding structure). However, it does not explicitly mention alternatives or when not to use this tool, so it falls short of a perfect 5.

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