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"],
        },
    ),
Behavior2/5

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

With no annotations provided, the description carries full burden but only states the action without disclosing behavioral traits like authentication needs, rate limits, error handling, or what the execution entails (e.g., side effects, response format). It mentions 'Tooling API' but doesn't explain its characteristics or constraints.

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 with zero waste, clearly front-loaded as 'Executes a Tooling API request'. It is appropriately sized for the tool's complexity and doesn't include unnecessary details.

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 tool's complexity (3 parameters, no output schema, and no annotations), the description is incomplete. It doesn't explain what the Tooling API is, what the output might look like, or provide context for usage, leaving significant gaps for an AI agent to understand and invoke the tool correctly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema fully documents parameters like 'action', 'method', and 'data'. The description adds no additional meaning beyond what the schema provides, such as examples of common actions or data formats, but the high coverage justifies a baseline score of 3.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose3/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description 'Executes a Tooling API request' states a general purpose but lacks specificity about what the Tooling API is or what resources it operates on. It distinguishes from siblings like 'apex_execute' or 'restful' by mentioning 'Tooling API', but doesn't clarify the verb beyond 'executes' or detail the scope of operations.

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?

No guidance is provided on when to use this tool versus alternatives such as 'apex_execute' or 'restful', which might handle similar API requests. The description implies a generic API execution but doesn't specify contexts, prerequisites, or exclusions for usage.

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

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