Skip to main content
Glama
security-use

Security-Use MCP Server

by security-use

block_ip

Block malicious IP addresses to prevent unauthorized access and security threats. Specify duration to control temporary or permanent blocking.

Instructions

Block a source IP address. Adds the IP to the sensor's block list for the specified duration.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
ip_addressYesIP address to block.
durationNoBlock duration (e.g., '1h', '24h', 'permanent'). Defaults to '24h'.

Implementation Reference

  • The main handler function for block_ip tool. Takes arguments dict, validates ip_address is present, and returns a TextContent response directing users to the SecurityUse dashboard for IP blocking management.
    async def handle_block_ip(arguments: dict[str, Any]) -> list[TextContent]:
        """Block IP - requires dashboard integration."""
        ip_address = arguments.get("ip_address")
        if not ip_address:
            return [TextContent(type="text", text="Error: `ip_address` is required")]
    
        return [
            TextContent(
                type="text",
                text=(
                    f"## Block IP: {ip_address}\n\n"
                    "IP blocking is managed through the SecurityUse dashboard.\n\n"
                    "Visit https://securityuse.dev to manage your block list."
                ),
            )
        ]
  • Tool registration schema for block_ip. Defines the tool name, description, and inputSchema with properties: ip_address (required string) and duration (optional string with default '24h').
        name="block_ip",
        description=(
            "Block a source IP address. "
            "Adds the IP to the sensor's block list for the specified duration."
        ),
        inputSchema={
            "type": "object",
            "properties": {
                "ip_address": {
                    "type": "string",
                    "description": "IP address to block.",
                },
                "duration": {
                    "type": "string",
                    "description": (
                        "Block duration (e.g., '1h', '24h', 'permanent'). Defaults to '24h'."
                    ),
                },
            },
            "required": ["ip_address"],
        },
    ),
  • Handler mapping that registers 'block_ip' tool name to the handle_block_ip function in the handlers dictionary.
    "block_ip": handle_block_ip,
  • Import statement that imports handle_block_ip from the .handlers module, making it available for tool registration.
    from .handlers import (
        handle_acknowledge_alert,
        handle_analyze_request,
        handle_block_ip,
        handle_check_compliance,
  • Re-exports handle_block_ip from sensor_handler module and includes it in __all__ for public API exposure.
    from .sensor_handler import (
        handle_acknowledge_alert,
        handle_analyze_request,
        handle_block_ip,
        handle_configure_sensor,
        handle_detect_vulnerable_endpoints,
        handle_get_alert_details,
        handle_get_blocked_ips,
        handle_get_security_alerts,
        handle_get_sensor_config,
    )
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It mentions adding to a 'block list' and specifies duration, but omits critical details like required permissions, whether the block is reversible, rate limits, or error handling. For a mutation tool with zero annotation coverage, this is a significant gap in transparency.

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 front-loaded with the core purpose in the first sentence and adds essential context in the second. Every sentence earns its place by clarifying the action and scope, with zero wasted words, making it highly efficient and well-structured.

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?

Given the tool's complexity as a mutation operation with no annotations and no output schema, the description is incomplete. It fails to address behavioral aspects like side effects (e.g., network impact), success/failure responses, or integration with sibling tools (e.g., 'get_blocked_ips'). More detail is needed for safe and effective use.

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?

Schema description coverage is 100%, so the schema already documents both parameters ('ip_address' and 'duration') thoroughly. The description adds no additional meaning beyond what the schema provides, such as format examples for 'ip_address' or implications of 'permanent' duration. Baseline 3 is appropriate when the schema handles parameter documentation.

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 specific action ('Block a source IP address') and resource ('IP address'), distinguishing it from siblings like 'get_blocked_ips' (which retrieves) or 'configure_sensor' (which modifies settings). It precisely conveys the tool's function without ambiguity.

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 provides no guidance on when to use this tool versus alternatives, such as 'acknowledge_alert' for handling alerts or 'configure_sensor' for broader sensor settings. It lacks context about prerequisites (e.g., needing sensor access) or exclusions (e.g., not for internal IPs), leaving usage decisions unclear.

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/security-use/mcp'

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