Skip to main content
Glama

salesforce_list_objects

Retrieve all Salesforce object names (SObjects) to discover available data entities in your Salesforce organization for integration and query planning.

Instructions

Get list of all Salesforce object names (SObjects)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
total_countYesTotal number of objects
object_namesYesList of Salesforce object names

Implementation Reference

  • The main tool handler function that instantiates SalesforceClient from environment settings and calls its list_objects method, wrapping the result in ListObjectsResult.
    async def list_salesforce_objects() -> ListObjectsResult:
        """Get list of Salesforce object names"""
        sf = SalesforceClient.from_env()
        object_names = await sf.list_objects()
        return ListObjectsResult(
            object_names=object_names, total_count=len(object_names)
        )
  • Pydantic BaseModel defining the input/output schema for the salesforce_list_objects tool response.
    class ListObjectsResult(BaseModel):
        object_names: List[str] = Field(..., description="List of Salesforce object names")
        total_count: int = Field(..., description="Total number of objects")
  • The register function that defines the tool using @mcp.tool decorator, specifying name and description.
    def register(mcp: FastMCP) -> None:
        @mcp.tool(
            name="salesforce_list_objects",
            description="Get list of all Salesforce object names (SObjects)",
        )
        async def list_salesforce_objects() -> ListObjectsResult:
            """Get list of Salesforce object names"""
            sf = SalesforceClient.from_env()
            object_names = await sf.list_objects()
            return ListObjectsResult(
                object_names=object_names, total_count=len(object_names)
            )
  • sfmcp/server.py:23-33 (registration)
    The _register_all function called on server startup that invokes register on the list_objects tool module (line 26), thereby registering the tool with the MCP server.
    def _register_all() -> None:
        tool_query.register(mcp)
        tool_describe.register(mcp)
        tool_list_objects.register(mcp)
        tool_list_flows.register(mcp)
        tool_list_reports.register(mcp)
        tool_list_dashboards.register(mcp)
        tool_describe_flow.register(mcp)
        # res_saved_queries.register(mcp)
        # prm_opps_by_stage.register(mcp)
  • Supporting utility in SalesforceClient that runs the 'sf force:schema:sobject:list' CLI command to retrieve the list of SObject names asynchronously.
    async def list_objects(self) -> List[str]:
        """Get list of all Salesforce object names"""
        command = [
            "sf",
            "force:schema:sobject:list",
            "--target-org",
            self._org_alias,
            "--json",
        ]
        result = await self._run_cli_command(command)
    
        if "result" in result and isinstance(result["result"], list):
            return result["result"]
        else:
            raise Exception("Unexpected response format from Salesforce CLI")
Behavior2/5

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

No annotations are provided, so the description carries full burden. It states it 'gets' a list, implying a read-only operation, but doesn't disclose behavioral traits such as authentication requirements, rate limits, pagination, or what the output includes (e.g., format, sorting). This is a significant gap for a tool with no annotation coverage.

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 directly states the tool's purpose without any wasted words. It's appropriately sized and front-loaded, making it easy to understand quickly.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's simplicity (0 parameters, output schema exists), the description is minimally adequate. However, with no annotations and an output schema, it doesn't explain return values or behavioral context, leaving gaps in completeness for a read operation tool.

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

Parameters4/5

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

The tool has 0 parameters, and schema description coverage is 100%, so no parameter documentation is needed. The description doesn't add param info, but with no params, a baseline of 4 is appropriate as it doesn't need to compensate for gaps.

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 verb 'Get' and the resource 'list of all Salesforce object names (SObjects)', making the purpose specific and understandable. However, it doesn't explicitly differentiate from sibling tools like 'salesforce_describe' or 'salesforce_query', which likely provide more detailed object metadata or query capabilities, preventing a perfect score.

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. The description doesn't mention contexts like needing a high-level overview vs. detailed metadata or querying, and there are no exclusions or prerequisites stated, leaving usage unclear relative to siblings.

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/mattmahowald/sfmcp'

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