Skip to main content
Glama
smn2gnt

MCP Salesforce Connector

by smn2gnt

restful

Execute direct REST API calls to Salesforce to interact with data, manage records, and retrieve metadata using specified HTTP methods, paths, and parameters.

Instructions

Makes a direct REST API call to Salesforce

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
dataNoData for POST/PATCH requests
methodNoThe HTTP method (default: 'GET')GET
paramsNoQuery parameters for the request
pathYesThe path of the REST API endpoint (e.g., 'sobjects/Account/describe')

Implementation Reference

  • Handler logic for the 'restful' tool in the @server.call_tool() dispatcher. Extracts path, method, params, data from arguments, performs validation, executes sf_client.sf.restful() call, and formats the result as JSON text content.
    elif name == "restful":
        path = arguments.get("path")
        method = arguments.get("method", "GET")
        params = arguments.get("params")
        data = arguments.get("data")
    
        if not path:
            raise ValueError("Missing 'path' argument")
        if not sf_client.sf:
            raise ValueError("Salesforce connection not established.")
    
        results = sf_client.sf.restful(path, method=method, params=params, json=data)
        return [
            types.TextContent(
                type="text",
                text=f"RESTful API Call Result (JSON):\n{json.dumps(results, indent=2)}",
            )
        ]
  • Registration of the 'restful' MCP tool in the @server.list_tools() function, defining its name, description, and JSON input schema for validation.
    types.Tool(
        name="restful",
        description="Makes a direct REST API call to Salesforce",
        inputSchema={
            "type": "object",
            "properties": {
                "path": {
                    "type": "string",
                    "description": "The path of the REST API endpoint (e.g., 'sobjects/Account/describe')",
                },
                "method": {
                    "type": "string",
                    "description": "The HTTP method (default: 'GET')",
                    "enum": ["GET", "POST", "PATCH", "DELETE"],
                    "default": "GET",
                },
                "params": {
                    "type": "object",
                    "description": "Query parameters for the request",
                    "properties": {},
                    "additionalProperties": True,
                },
                "data": {
                    "type": "object",
                    "description": "Data for POST/PATCH requests",
                    "properties": {},
                    "additionalProperties": True,
                },
            },
            "required": ["path"],
        },
    ),
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 but offers minimal information. It mentions it's a 'direct REST API call' which implies it can perform any HTTP operation, but doesn't cover authentication requirements, rate limits, error handling, response formats, or any Salesforce-specific constraints. The description doesn't contradict annotations (none exist), but fails to provide adequate behavioral context.

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 any wasted words. It's appropriately sized for a general-purpose tool and front-loads the essential information. Every word earns its place in this concise formulation.

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?

For a powerful, low-level API call tool with 4 parameters, no annotations, and no output schema, the description is insufficiently complete. It doesn't address critical context like authentication requirements, Salesforce API versioning, response handling, error patterns, or when to prefer this over specialized siblings. The single sentence leaves too many operational questions unanswered.

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?

With 100% schema description coverage, the schema already documents all 4 parameters thoroughly. The description adds no parameter-specific information beyond what's in the schema - it doesn't explain how parameters interact, provide endpoint examples beyond the single 'sobjects/Account/describe' in the schema, or clarify Salesforce-specific parameter conventions. The baseline of 3 is appropriate when the schema does the heavy lifting.

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 action ('Makes a direct REST API call') and target resource ('to Salesforce'), providing a specific verb+resource combination. However, it doesn't distinguish this general-purpose API call tool from its more specialized siblings like create_record, update_record, or run_soql_query, which would require explicit differentiation.

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 the many specialized alternatives available (create_record, update_record, run_soql_query, etc.). There's no mention of prerequisites, appropriate use cases, or warnings about when this lower-level API call might be preferred over higher-level abstractions.

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

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

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