Skip to main content
Glama
codefriar

Salesforce CLI MCP Server

sf_detect_project_directory

Identify and configure Salesforce project directories to enable command execution for development workflows.

Instructions

Get instructions for setting up Salesforce project directories for command execution

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Inline asynchronous handler function for the 'sf_detect_project_directory' tool. It returns textual instructions guiding the user on how to set a Salesforce project directory, as direct message context access is not available in this MCP version.
    server.tool('sf_detect_project_directory', 'Get instructions for setting up Salesforce project directories for command execution', {}, async () => {
        // Since we can't access the message in this version of MCP,
        // we need to rely on the LLM to extract the directory and use sf_set_project_directory
        
        return {
            content: [
                {
                    type: 'text',
                    text: 'To set a project directory, please use sf_set_project_directory with the path to your Salesforce project, or include the project path in your message using formats like "Execute in /path/to/project" or "Use project in /path/to/project".',
                },
            ],
        };
    });
  • src/index.ts:51-63 (registration)
    Registration of the 'sf_detect_project_directory' tool using server.tool(), including an empty input schema {} and the inline handler function.
    server.tool('sf_detect_project_directory', 'Get instructions for setting up Salesforce project directories for command execution', {}, async () => {
        // Since we can't access the message in this version of MCP,
        // we need to rely on the LLM to extract the directory and use sf_set_project_directory
        
        return {
            content: [
                {
                    type: 'text',
                    text: 'To set a project directory, please use sf_set_project_directory with the path to your Salesforce project, or include the project path in your message using formats like "Execute in /path/to/project" or "Use project in /path/to/project".',
                },
            ],
        };
    });
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. It states the tool 'Get instructions,' implying a read-only operation that returns guidance, but it doesn't clarify if this requires specific permissions, what format the instructions are in, or if there are any side effects. For a tool with zero annotation coverage, this leaves significant behavioral gaps.

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, clear sentence: 'Get instructions for setting up Salesforce project directories for command execution.' It is front-loaded with the main purpose, has no unnecessary words, and efficiently conveys the tool's intent without waste.

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 has 0 parameters, no annotations, and no output schema, the description is minimally adequate. It states what the tool does but lacks details on the instruction format, prerequisites, or how it relates to sibling tools. For a tool that likely provides setup guidance, more context on the output or usage scenarios would improve completeness.

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 there are no parameters to document. The description doesn't need to add parameter semantics beyond what the schema provides. A baseline score of 4 is appropriate as the description doesn't introduce confusion about parameters.

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: 'Get instructions for setting up Salesforce project directories for command execution.' It specifies the action ('Get instructions') and resource ('Salesforce project directories'), though it doesn't explicitly distinguish it from sibling tools like sf_set_project_directory. The purpose is clear but lacks sibling 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 alternatives. It doesn't mention prerequisites, timing, or relationships with sibling tools such as sf_set_project_directory (which might actually set the directory) or sf_list_roots (which might list available directories). Without such context, the agent lacks clear usage direction.

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/codefriar/sf-mcp'

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