Skip to main content
Glama
ckanthony

Chisel

shell_exec

Execute whitelisted shell commands with literal arguments and path validation. Kernel-enforced confinement restricts file access to a configured root, enabling targeted reads and reducing context usage.

Instructions

Execute a whitelisted shell command (grep/cat/ls/find/sed/awk/…). No shell interpreter — args are passed literally. Path args validated against root.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
argsYes
commandYes

Implementation Reference

  • The handler function 'chisel_shell_exec' which delegates to the underlying chisel tool by calling _chisel_call with tool name 'shell_exec'.
    async def chisel_shell_exec(command: str, args: list[str]) -> str:
        return await _chisel_call("shell_exec", command=command, args=args)
  • Helper function '_chisel_call' that opens a streaming HTTP MCP session to chisel and calls the specified tool; used by shell_exec handler.
    async def _chisel_call(tool: str, **kwargs) -> str:
        """Open a session to chisel, call one tool, return the text result."""
        async with streamablehttp_client(CHISEL_URL, headers=_HEADERS) as (read, write, _):
            async with ClientSession(read, write) as session:
                await session.initialize()
                result = await session.call_tool(tool, kwargs)
                return result.content[0].text
  • The 'run_lint' MCP tool handler that uses 'chisel_shell_exec' to run 'rg' (ripgrep) for counting TODO markers.
    @mcp.tool()
    async def run_lint(path: str) -> str:
        """
        Run rg (ripgrep) over a file to count TODO markers.
        Delegates to chisel's shell_exec — path is validated server-side.
    
        Args:
            path: Absolute path to the file to inspect
        """
        result = await chisel_shell_exec("rg", ["--count", "TODO", path])
        return result or "No TODO markers found."
  • Registration of the FastMCP server instance named 'my-project-server' which hosts the MCP tools including run_lint that uses shell_exec.
    mcp = FastMCP("my-project-server")
Behavior3/5

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

No annotations present, so description must carry the burden. It discloses that there is no shell interpreter and that args are passed literally, and path validation occurs. However, it omits behavior on non-whitelisted commands, error handling, and output details.

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 three sentences, no fluff, front-loaded with purpose. Each sentence adds essential information about what the tool does and its behavioral constraints.

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

Completeness3/5

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

Given the complexity of shell execution and lack of annotations or output schema, the description covers key constraints but misses return value format, sync/async behavior, and explicit failure modes. Adequate but incomplete.

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

Parameters2/5

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

Schema description coverage is 0%, so description must compensate. It explains that 'args are passed literally' and 'path args validated against root' but does not clarify the structure of the args array or the acceptable values for command beyond examples. Insufficient detail for both parameters.

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 executes whitelisted shell commands with examples (grep/cat/ls/find/sed/awk). It distinguishes from siblings which are file operations like append and write.

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 guidance on when to use: for whitelisted shell commands, with literal argument passing and path validation. It does not explicitly exclude alternatives but gives clear constraints.

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/ckanthony/chisel'

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