Skip to main content
Glama

restful

Execute direct REST API calls to Salesforce to interact with data and metadata, supporting GET, POST, PATCH, and DELETE operations for custom integrations.

Instructions

Makes a direct REST API call to Salesforce

Input Schema

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

Implementation Reference

  • Handler for the 'restful' tool: extracts arguments, validates, calls sf_client.sf.restful(path, method, params, json=data), and returns formatted JSON result.
    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' tool in handle_list_tools(), defining its name, description, and input schema for path (required), method, params, data.
    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?

No annotations are provided, so the description carries the full burden of behavioral disclosure. While 'direct REST API call' implies it can perform various HTTP operations, the description doesn't mention authentication requirements, rate limits, error handling, response formats, or any side effects. For a tool that can execute DELETE or POST operations, this lack of behavioral context is a significant gap.

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 extremely concise - a single sentence that directly states the tool's core function. There's no wasted language or unnecessary elaboration. It's front-loaded with the essential information, making it efficient for quick understanding.

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 tool with 4 parameters (including nested objects), no annotations, and no output schema, the description is insufficient. A direct REST API call tool that can perform GET, POST, PATCH, and DELETE operations needs more context about authentication, error handling, response formats, and when to use it versus specialized sibling tools. The single sentence doesn't provide adequate guidance for safe and effective use.

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?

The description adds no parameter-specific information beyond what's already in the schema. Since schema description coverage is 100%, all parameters are documented in the schema itself. The description doesn't provide additional context about parameter usage, relationships between parameters, or examples beyond what the schema already covers.

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 tool's purpose: 'Makes a direct REST API call to Salesforce.' This specifies the verb ('makes'), resource ('REST API call'), and target system ('Salesforce'). However, it doesn't explicitly differentiate this from sibling tools like apex_execute or tooling_execute, which also make API calls but to different Salesforce APIs.

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 alternatives. With siblings like create_record, update_record, run_soql_query, and get_record that handle specific operations, there's no indication of when a direct REST call is preferred over these higher-level tools. No exclusions or prerequisites are mentioned.

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