Skip to main content
Glama
natl-set

ANTLR4 MCP Server

by natl-set

list-rules

Fetch all rules from an ANTLR4 grammar, optionally filtered by lexer or parser type. Returns an alphabetized list with rule definitions, types, and line numbers.

Instructions

List all rules in an ANTLR4 grammar with optional filtering.

When to use: Get a quick overview of all rules, or filter to see only lexer or parser rules.

Example usage: filter_type: "lexer" // Shows only lexer rules (uppercase) filter_type: "parser" // Shows only parser rules (lowercase) filter_type: "all" // Shows all rules (default)

Returns: Alphabetically sorted list of rules with:

  • Rule names

  • Rule types (lexer/parser)

  • Complete definitions

  • Line numbers

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
from_fileNoOptional: path to a grammar file to read
filter_typeNoFilter rules by type (default: all)
grammar_contentNoThe content of the ANTLR4 grammar file
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. It discloses the output format (alphabetically sorted list, rule names, types, definitions, line numbers) and explains filter_type behavior with examples. However, it does not explain what happens if both from_file and grammar_content are provided or if neither is provided, leaving minor ambiguity.

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?

The description is well-structured with clear sections: main action, when to use, example, and returns. It is somewhat lengthy but each part provides useful information, with no redundant filler.

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?

The tool is a read-only listing operation with no output schema, so the description adequately covers purpose, usage, and return format. Gaps remain around input source precedence and handling of multiple input parameters, but overall it is complete enough for an agent to invoke the tool correctly.

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 example usage for filter_type, including the semantic detail that lexer rules are uppercase and parser rules are lowercase. This goes beyond the schema's basic 'Filter rules by type'.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool lists all rules in an ANTLR4 grammar with optional filtering. It is specific ('List all rules') and identifies the resource ('ANTLR4 grammar'), but does not explicitly differentiate from the sibling tool 'list-mode-rules'.

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 'When to use' section provides context: getting a quick overview or filtering by lexer/parser. It does not mention exclusions or mention alternative tools, so it stops short of explicit when-not guidance.

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