Skip to main content
Glama

boj_cartridge_invoke

Execute commands on specific cartridges to perform operations like database management or version control through a unified server gateway.

Instructions

Invoke a BoJ cartridge operation. Send a command to a specific cartridge for execution.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYesCartridge name (e.g. database-mcp, git-mcp)
paramsNoParameters to pass to the cartridge invocation

Implementation Reference

  • The `invokeCartridge` function acts as the handler for the tool, making an HTTP POST request to the BoJ server to invoke the specified cartridge.
    async function invokeCartridge(name, params) {
      if (!isValidCartridgeName(name)) {
        return { error: `Invalid cartridge name: ${name}` };
      }
      try {
        const res = await fetch(`${BOJ_BASE}/cartridge/${encodeURIComponent(name)}/invoke`, {
          method: "POST",
          headers: { "Content-Type": "application/json" },
          body: JSON.stringify(params || {}),
        });
        return await res.json();
      } catch {
        return { error: "BoJ REST API not reachable. Invocation requires a running server.", cartridge: name, hint: "Start with: systemctl --user start boj-server" };
      }
    }
  • Registration of the `boj_cartridge_invoke` tool in the MCP server setup.
    tools.push({
      name: "boj_cartridge_invoke",
      description:
        "Invoke a BoJ cartridge operation. Send a command to a specific cartridge for execution.",
      inputSchema: {
        type: "object",
        properties: {
          name: {
            type: "string",
            description: "Cartridge name (e.g. database-mcp, git-mcp)",
          },
          params: {
            type: "object",
            description: "Parameters to pass to the cartridge invocation",
          },
        },
        required: ["name"],
      },
    });
  • The switch case block in the request handler that routes requests for `boj_cartridge_invoke` to the `invokeCartridge` function.
    case "boj_cartridge_invoke": {
      const result = await invokeCartridge(args.name, args.params);
      sendResult(id, {
        content: [
          { type: "text", text: JSON.stringify(result, null, 2) },
        ],
      });
      break;
    }

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/hyperpolymath/boj-server'

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