Skip to main content
Glama

kill_process

Terminate a running process by its ID using the Frida MCP server. Specify the process ID to stop execution and manage system resources.

Instructions

Kill a process by ID.

Returns:
    Status information

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pidYesThe ID of the process to kill.
device_idNoOptional ID of the device where the process is running. Uses smart selection when omitted.

Implementation Reference

  • The implementation of the kill_process tool handler. It is registered via the @mcp.tool() decorator. The function resolves the target device using _resolve_device_or_raise, calls the Frida device's kill method on the specified PID, and returns a success dict or raises a ValueError on failure. The Field annotations define the input schema.
    @mcp.tool()
    def kill_process(
        pid: int = Field(description="The ID of the process to kill."),
        device_id: Optional[str] = Field(
            default=None,
            description="Optional ID of the device where the process is running. Uses smart selection when omitted.",
        ),
    ) -> Dict[str, Any]:
        """Kill a process by ID.
    
        Returns:
            Status information
        """
        try:
            device = _resolve_device_or_raise(device_id)
            device.kill(pid)
    
            return {"success": True, "pid": pid}
        except Exception as e:
            raise ValueError(f"Failed to kill process {pid}: {str(e)}")

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/rmorgans/frida-mcp'

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