Skip to main content
Glama

bash

Execute bash commands on Scrapybara virtual Ubuntu instances to run code, automate tasks, and control remote environments through shell operations.

Instructions

Run a bash command in a Scrapybara instance.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
instance_idYesThe ID of the instance to run the command on.
commandYesThe command to run in the instance shell.

Implementation Reference

  • Handler for the 'bash' MCP tool: parses arguments using BashSchema, retrieves Scrapybara instance, calls instance.bash(command), and returns the response.
    case "bash": {
      const args = BashSchema.parse(request.params.arguments);
      const instance = await client.get(args.instance_id, {
        abortSignal: currentController.signal,
      });
    
      if ("bash" in instance) {
        const response = await instance.bash(
          { command: args.command },
          { abortSignal: currentController.signal }
        );
    
        return {
          content: [
            {
              type: "text",
              text: JSON.stringify(response, null, 2),
            } as TextContent,
          ],
        };
      } else {
        throw new Error("Instance does not support bash commands");
      }
    }
  • Zod schema defining input for bash tool: instance_id (string) and command (string). Used for validation in handler and JSON schema in registration.
    export const BashSchema = z.object({
      instance_id: z
        .string()
        .describe("The ID of the instance to run the command on."),
      command: z.string().describe("The command to run in the instance shell."),
    });
  • src/index.ts:89-92 (registration)
    Tool registration in listTools response: defines name 'bash', description, and input schema derived from BashSchema.
      name: "bash",
      description: "Run a bash command in a Scrapybara instance.",
      inputSchema: zodToJsonSchema(BashSchema),
    },

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/Scrapybara/scrapybara-mcp'

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