Skip to main content
Glama

db_workspaces

List all available workspaces in Metasploit Framework to organize and manage penetration testing data for security assessments.

Instructions

List all Metasploit workspaces

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Handler for the db_workspaces tool: executes the 'workspace' command in Metasploit console to list all workspaces and returns the result in JSON format.
    case "db_workspaces": {
      try {
        const workspaces = await executeMsfCommand([`workspace`]);
        return {
          content: [
            {
              type: "text",
              text: JSON.stringify(
                {
                  success: true,
                  workspaces,
                },
                null,
                2
              ),
            },
          ],
        };
      } catch (error: any) {
        return {
          content: [
            {
              type: "text",
              text: JSON.stringify({
                success: false,
                error: error.message,
              }),
            },
          ],
        };
      }
    }
  • src/index.ts:145-152 (registration)
    Registration of the db_workspaces tool in the tools array, including its name, description, and empty input schema.
    {
      name: "db_workspaces",
      description: "List all Metasploit workspaces",
      inputSchema: {
        type: "object",
        properties: {},
      },
    },
  • Input schema for the db_workspaces tool: accepts no parameters.
    inputSchema: {
      type: "object",
      properties: {},
    },
  • Helper function executeMsfCommand used by db_workspaces handler to run Metasploit console commands.
    async function executeMsfCommand(commands: string[]): Promise<string> {
      const commandString = commands.join("; ");
      const fullCommand = `msfconsole -q -x "${commandString}; exit"`;
      
      try {
        const { stdout, stderr } = await execAsync(fullCommand, {
          timeout: 60000, // 60 second timeout
          maxBuffer: 10 * 1024 * 1024, // 10MB buffer
        });
        return stdout || stderr;
      } catch (error: any) {
        throw new Error(error.message || "Command execution failed");
      }
    }
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. It states it's a list operation, implying read-only behavior, but doesn't mention potential side effects, authentication requirements, rate limits, or what the output format looks like. This leaves significant gaps for a tool interacting with a security database.

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 a single, efficient sentence that communicates the core purpose without unnecessary words. It's appropriately sized for a simple list tool and front-loads the essential information.

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 complexity of database operations and lack of both annotations and output schema, the description is insufficient. It doesn't explain what a 'workspace' entails in Metasploit context, how results are returned, or any behavioral constraints, making it incomplete for safe and effective use.

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?

The tool has zero parameters with 100% schema description coverage, so no parameter documentation is needed. The description appropriately doesn't discuss parameters, earning a baseline score of 4 for this dimension.

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?

The description clearly states the verb ('List') and resource ('all Metasploit workspaces'), making the purpose immediately understandable. It doesn't differentiate from sibling tools like 'db_hosts' or 'db_services' which also list database entities, but the specific resource type is unambiguous.

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. It doesn't mention prerequisites, timing considerations, or how it relates to sibling tools like 'db_status' or 'nmap_scan', leaving the agent to infer usage context independently.

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/andreransom58-coder/kali-metasploit-mcp'

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