Skip to main content
Glama

msf_session_execute

Execute commands in an active Metasploit session to run exploits, set options, and automate penetration testing tasks.

Instructions

Execute a command in an existing Metasploit session.

Args: session_id: The session ID from msf_session_create command: The Metasploit command to execute (e.g., "use exploit/...", "set RHOSTS ...", "run") timeout: Command timeout in seconds (default: 300) read_delay: Seconds to wait before reading output for slow-responding commands (default: 2)

Returns: Command output and status

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
commandYes
timeoutNo
read_delayNo
session_idYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior2/5

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

With no annotations provided, the description bears full responsibility for behavioral disclosure. It states that commands are executed and output is returned, but it does not elaborate on side effects, destructiveness, or safety implications. The parameters timeout and read_delay hint at behavior but lack depth.

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 concise, starting with a clear purpose sentence followed by a well-structured bullet list for arguments and returns. Every sentence serves a purpose without wasted words.

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

Completeness4/5

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

Given the output schema exists, the description's brief 'Returns: Command output and status' is adequate. It covers inputs, purpose, and outputs, though it could mention potential errors or the need for a valid session.

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 coverage is 0%, yet the description adds value for all four parameters: session_id (source identified), command (with examples), timeout (default and unit), and read_delay (purpose explained: 'for slow-responding commands'). This compensates well for the schema's lack of descriptions.

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 'Execute a command in an existing Metasploit session,' specifying the verb (Execute) and resource (command in a session). It distinguishes from sibling tools like msf_session_create (which creates sessions) and msf_session_destroy (which destroys them), leaving no ambiguity about its role.

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?

The description implies usage after a session is created (via reference to 'existing Metasploit session' and session_id from msf_session_create), but it does not explicitly state when to use this tool versus alternatives, nor does it mention exclusions or prerequisites beyond having a session.

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/zebbern/zebbern-kali-mcp'

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