Skip to main content
Glama
mumez

smalltalk-validator-mcp-server

lint_tonel_smalltalk

Analyze Tonel Smalltalk source code from a content string to detect linting issues and ensure code quality.

Instructions

Lint Tonel formatted Smalltalk source code from content string.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
file_contentYesThe Tonel file content as a string

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Implementation of lint_tonel_smalltalk_impl - the core handler that creates a TonelCSTLinter, runs lint checks on content string, converts issues to dicts, and returns results with success, content_length, issue_list, warnings_count, errors_count.
    def lint_tonel_smalltalk_impl(file_content: str) -> dict[str, Any]:
        """
        Lint Tonel formatted Smalltalk source code from content string.
    
        Args:
            file_content: The Tonel file content as a string
    
        Returns:
            Dictionary with lint results including issues found
        """
        try:
            linter = TonelCSTLinter()
            issues = linter.lint(file_content)
    
            issue_list = _convert_lint_issues_to_dicts(issues)
    
            return {
                "success": True,
                "content_length": len(file_content),
                "issue_list": issue_list,
                "warnings_count": linter.warnings,
                "errors_count": linter.errors,
                "issues_count": len(issue_list),
            }
    
        except Exception as e:
            return {
                "success": False,
                "error": f"Linting failed: {str(e)}",
                "content_length": len(file_content),
                "exception": type(e).__name__,
            }
  • Implementation of lint_tonel_smalltalk_from_file_impl - core handler that reads file then lints it using TonelCSTLinter.
    def lint_tonel_smalltalk_from_file_impl(file_path: str) -> dict[str, Any]:
        """
        Lint Tonel formatted Smalltalk source code from a file.
    
        Args:
            file_path: Path to the Tonel file to lint
    
        Returns:
            Dictionary with lint results including issues found
        """
        try:
            if not os.path.exists(file_path):
                return {
                    "success": False,
                    "error": f"File not found: {file_path}",
                    "file_path": file_path,
                }
    
            linter = TonelCSTLinter()
            issues = linter.lint_from_file(Path(file_path))
    
            issue_list = _convert_lint_issues_to_dicts(issues)
    
            return {
                "success": True,
                "file_path": file_path,
                "issue_list": issue_list,
                "warnings_count": linter.warnings,
                "errors_count": linter.errors,
                "issues_count": len(issue_list),
            }
    
        except Exception as e:
            return {
                "success": False,
                "error": f"Linting failed: {str(e)}",
                "file_path": file_path,
                "exception": type(e).__name__,
            }
  • MCP tool registration: @app.tool('lint_tonel_smalltalk') registers the FastMCP tool that delegates to lint_tonel_smalltalk_impl.
    @app.tool("lint_tonel_smalltalk")
    def lint_tonel_smalltalk(_: Context, file_content: str) -> dict[str, Any]:
        """
        Lint Tonel formatted Smalltalk source code from content string.
    
        Args:
            file_content: The Tonel file content as a string
    
        Returns:
            Dictionary with lint results including issues found
        """
        return lint_tonel_smalltalk_impl(file_content)
  • MCP tool registration: @app.tool('lint_tonel_smalltalk_from_file') registers the file-based lint tool, delegating to lint_tonel_smalltalk_from_file_impl.
    @app.tool("lint_tonel_smalltalk_from_file")
    def lint_tonel_smalltalk_from_file(_: Context, file_path: str) -> dict[str, Any]:
        """
        Lint Tonel formatted Smalltalk source code from a file.
    
        Args:
            file_path: Path to the Tonel file to lint
    
        Returns:
            Dictionary with lint results including issues found
        """
        return lint_tonel_smalltalk_from_file_impl(file_path)
  • Schema/type info for lint_tonel_smalltalk: accepts file_content: str, returns dict[str, Any].
    def lint_tonel_smalltalk(_: Context, file_content: str) -> dict[str, Any]:
        """
        Lint Tonel formatted Smalltalk source code from content string.
    
        Args:
Behavior1/5

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

With no annotations provided, the description bears full responsibility for disclosing behavioral traits. It only states 'Lint Tonel formatted Smalltalk source code' without explaining what linting entails (e.g., errors/warnings output, whether it is destructive, or how it handles invalid input). This is a significant gap.

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 a single sentence with no wasted words. However, given the lack of other context (annotations, usage guidelines), it may be too concise to fully support tool selection.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

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

Although an output schema exists (reducing need to describe return values), the description fails to clarify differences from sibling validate tools or specify input format expectations. The context of sibling tools calls for more differentiation and behavioral detail.

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 describes the single parameter 'file_content' as 'The Tonel file content as a string'. The description adds minimal value beyond this ('from content string'), but schema coverage is 100%, so a baseline of 3 is appropriate.

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 uses the specific verb 'Lint' and resource 'Tonel formatted Smalltalk source code', and specifies the input source 'from content string'. This clearly distinguishes it from the sibling tool 'lint_tonel_smalltalk_from_file', which likely takes a file path instead of a content string.

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

Usage Guidelines2/5

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

The description implies use when you have a content string, but it does not explicitly state when to use this tool versus alternatives like validate_tonel_smalltalk or validate_smalltalk_method_body. There is no guidance on when not to use it or how it differs from validating tools.

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/mumez/smalltalk-validator-mcp-server'

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