Skip to main content
Glama
natl-set

ANTLR4 MCP Server

by natl-set

export-as-markdown

Convert ANTLR4 grammars into comprehensive Markdown documentation covering rules, imports, options, and validation warnings for README or reference docs.

Instructions

Generate comprehensive Markdown documentation for your grammar.

When to use: Create README files, generate reference documentation, document grammar structure, share grammar specs.

Example usage: from_file: "MyGrammar.g4"

Generated documentation includes:

  • Grammar name, type, and metadata

  • Overview section with rule counts

  • Parser rules section with definitions and references

  • Lexer rules section with patterns

  • Import declarations

  • Grammar options

  • Validation issues and warnings

  • Summary statistics

Output format: Complete Markdown document ready for use in README.md or documentation sites.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
from_fileNoOptional: path to a grammar file to read
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 full burden of behavioral disclosure. It describes the output format (complete Markdown document), enumerates the sections included (overview, parser rules, lexer rules, etc.), and provides an example usage. While it doesn't explicitly state side-effect-free behavior, the nature of 'generate' plus the focus on documentation implies a non-destructive operation.

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 bolded sections and bullet lists, making it scannable. Every sentence adds value: purpose, when-to-use, example, output contents, and output format. It's 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.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The description addresses the tool's purpose, usage context, example, output format, and the content included in the generated documentation. Since there is no output schema, this textual explanation adequately covers what the tool returns. It provides enough context for an agent to select and invoke the tool correctly.

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?

The input schema already provides descriptions for both parameters, giving 100% coverage, so the baseline is 3. The description adds a concrete example using 'from_file' but doesn't clarify the relationship between the two optional parameters or handling when both/neither are provided.

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 opens with a specific verb ('Generate') and resource ('comprehensive Markdown documentation for your grammar'), clearly stating the tool's function. It distinguishes itself from sibling tools by focusing on Markdown export, while also listing explicit use cases like README creation and reference docs.

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 explicitly lists four concrete scenarios: creating README files, generating reference documentation, documenting grammar structure, and sharing grammar specs. It provides clear context for when to choose this tool, though it doesn't name alternatives or state when not to use it.

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