Skip to main content
Glama
codefriar

Salesforce CLI MCP Server

sf_cache_clear

Clear cached Salesforce CLI command metadata to force a refresh when commands appear outdated or malfunctioning.

Instructions

Clear the cached SF command metadata to force a refresh

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • src/index.ts:20-32 (registration)
    Registers the sf_cache_clear tool with an inline async handler that calls clearCommandCache() and formats the response.
    server.tool('sf_cache_clear', 'Clear the cached SF command metadata to force a refresh', {}, async () => {
        const result = clearCommandCache();
        return {
            content: [
                {
                    type: 'text',
                    text: result
                        ? 'Command cache cleared successfully.'
                        : 'Failed to clear command cache or cache did not exist.',
                },
            ]
        };
    });
  • The helper function that implements the cache clearing logic by deleting the cache file at CACHE_FILE path.
    export function clearCommandCache(): boolean {
        try {
            if (fs.existsSync(CACHE_FILE)) {
                fs.unlinkSync(CACHE_FILE);
                console.error(`Removed cache file: ${CACHE_FILE}`);
                return true;
            } else {
                console.error(`Cache file does not exist: ${CACHE_FILE}`);
                return false;
            }
        } catch (error) {
            console.error('Error clearing command cache:', error);
            return false;
        }
    }
Behavior3/5

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

With no annotations provided, the description carries the burden of behavioral disclosure. It indicates a mutation action ('Clear') that likely affects system state, but does not detail permissions, side effects, or error handling. It adds value by specifying the purpose (force refresh) but lacks depth on behavioral traits like reversibility or impact.

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 action and outcome with no wasted words. It is front-loaded and appropriately sized for a simple tool, 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 complexity (simple mutation with no parameters) and lack of annotations or output schema, the description is minimally adequate. It explains what the tool does but does not cover behavioral aspects like effects or usage context in depth. For a mutation tool, more disclosure would be beneficial, but it meets basic requirements.

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 input schema has 0 parameters with 100% coverage, so no parameter documentation is needed. The description does not add parameter details, which is appropriate. Baseline is 4 for zero parameters, as the description focuses on tool purpose without unnecessary parameter repetition.

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 ('Clear') and the target ('cached SF command metadata'), with the specific outcome of forcing a refresh. It distinguishes from siblings like sf_cache_refresh by emphasizing clearing rather than refreshing, though the distinction could be more explicit. No tautology or vagueness is present.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage when a refresh of metadata is needed, but does not explicitly state when to use this tool versus alternatives like sf_cache_refresh or other siblings. It provides some context (force a refresh) but lacks explicit guidance on prerequisites, exclusions, or comparisons with other tools.

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