Skip to main content
Glama

check_tool

Validate tool names for security compliance by blocking payment/transfer tools and flagging exec/shell tools as sensitive within the shellward MCP server.

Instructions

Check if a tool name is allowed. Blocks payment/transfer tools, flags exec/shell tools as sensitive.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
tool_nameYesTool name to check (e.g. "bash", "stripe_charge", "file_read")

Implementation Reference

  • The 'checkTool' method in the ShellWard class evaluates whether a specific MCP tool is allowed based on security policies (BLOCKED_TOOLS and SENSITIVE_TOOLS).
    checkTool(toolName: string): CheckResult {
      const toolLower = toolName.toLowerCase()
      const enforce = this.config.mode === 'enforce'
    
      if (BLOCKED_TOOLS.has(toolLower)) {
        const reason = this.locale === 'zh'
          ? `安全策略禁止自动执行: ${toolName}`
          : `Blocked by security policy: ${toolName}`
        this.log.write({
          level: 'CRITICAL',
          layer: 'L3',
          action: enforce ? 'block' : 'detect',
          detail: reason,
          tool: toolName,
        })
        return { allowed: false, level: 'CRITICAL', reason }
      }
    
      if (SENSITIVE_TOOLS.has(toolLower)) {
        this.log.write({
          level: 'MEDIUM',
          layer: 'L3',
          action: 'detect',
          detail: `Sensitive tool used: ${toolName}`,
          tool: toolName,
        })
      }
    
      return { allowed: true }
    }
Behavior3/5

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

Discloses key behavioral traits beyond missing annotations: distinguishes between 'Blocks' (hard stop) and 'flags as sensitive' (warning tier). However, omits what return value indicates allowance (boolean/object?), whether checks are cached, or what policy engine drives decisions. Adequate but not complete for a security gate with no annotations.

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?

Two sentences, zero fluff. First sentence states core function; second sentence details classification behavior. Perfect information density for the complexity level.

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?

Adequate for a single-parameter validation tool, but lacks description of return value semantics (crucial for a boolean/policy check with no output schema). Could clarify what 'allowed' means (present in manifest vs policy-compliant).

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 has 100% coverage with clear examples (bash, stripe_charge). Description adds semantic enrichment by mapping these examples to categories (exec/shell vs payment/transfer), helping agents understand what constitutes a sensitive tool name beyond the literal string value.

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?

Clear verb 'Check' and resource 'tool name' with specific scope (allowed vs disallowed). Differentiates from siblings by specifying it handles payment/transfer and exec/shell categories, implying this validates tool registration/allowlisting rather than command syntax (check_command) or injection patterns (check_injection).

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

Usage Guidelines3/5

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

Implies usage through examples of blocked (payment/transfer) and flagged (exec/shell) tool categories, but lacks explicit 'when to use this vs check_command' guidance. No mention of whether this should be called before tool invocation or during setup.

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/jnMetaCode/shellward'

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