Skip to main content
Glama

tooling_execute

Execute Tooling API requests to manage Salesforce metadata and development tools programmatically.

Instructions

Executes a Tooling API request

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
actionYesThe Tooling API endpoint to call (e.g., 'sobjects/ApexClass')
methodNoThe HTTP method (default: 'GET')GET
dataNoData for POST/PATCH requests

Implementation Reference

  • The handler logic within the handle_call_tool function that executes the tooling_execute tool by calling sf_client.sf.toolingexecute with the provided action, method, and data.
    elif name == "tooling_execute":
        action = arguments.get("action")
        method = arguments.get("method", "GET")
        data = arguments.get("data")
    
        if not action:
            raise ValueError("Missing 'action' argument")
        if not sf_client.sf:
            raise ValueError("Salesforce connection not established.")
    
        results = sf_client.sf.toolingexecute(action, method=method, data=data)
        return [
            types.TextContent(
                type="text",
                text=f"Tooling Execute Result (JSON):\n{json.dumps(results, indent=2)}",
            )
        ]
  • Registration of the tooling_execute tool in the handle_list_tools function, including its name, description, and input schema for Tooling API requests.
    types.Tool(
        name="tooling_execute",
        description="Executes a Tooling API request",
        inputSchema={
            "type": "object",
            "properties": {
                "action": {
                    "type": "string",
                    "description": "The Tooling API endpoint to call (e.g., 'sobjects/ApexClass')",
                },
                "method": {
                    "type": "string",
                    "description": "The HTTP method (default: 'GET')",
                    "enum": ["GET", "POST", "PATCH", "DELETE"],
                    "default": "GET",
                },
                "data": {
                    "type": "object",
                    "description": "Data for POST/PATCH requests",
                    "properties": {},
                    "additionalProperties": True,
                },
            },
            "required": ["action"],
        },
    ),
  • JSON schema defining the input parameters for the tooling_execute tool: action (required), method (optional), data (optional).
        inputSchema={
            "type": "object",
            "properties": {
                "action": {
                    "type": "string",
                    "description": "The Tooling API endpoint to call (e.g., 'sobjects/ApexClass')",
                },
                "method": {
                    "type": "string",
                    "description": "The HTTP method (default: 'GET')",
                    "enum": ["GET", "POST", "PATCH", "DELETE"],
                    "default": "GET",
                },
                "data": {
                    "type": "object",
                    "description": "Data for POST/PATCH requests",
                    "properties": {},
                    "additionalProperties": True,
                },
            },
            "required": ["action"],
        },
    ),

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/leilaabdel/MCP-Salesforce'

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