Skip to main content
Glama
conorluddy

XC-MCP: XCode CLI wrapper

by conorluddy

persistence-disable

Disable file-based persistence in XC-MCP, ensuring in-memory caching only. Optionally clears existing cache data to free disk space or meet privacy or CI/CD requirements. Use for troubleshooting or when persistent state management is unnecessary.

Instructions

šŸ”’ Disable Persistent State Management - Return to in-memory caching only.

Safely disables file-based persistence and optionally clears existing cache data. After disabling, XC-MCP will operate with in-memory caching only, losing state on server restart.

Use this when: • Privacy requirements change • Disk space is limited • Switching to CI/CD mode where persistence isn't needed • Troubleshooting cache-related issues

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
clearDataNoWhether to delete existing cached data files when disabling persistence

Implementation Reference

  • The handler function that implements the persistence-disable tool logic. It handles the disable operation, optionally clears data, interacts with persistenceManager, and returns structured JSON response.
    export async function persistenceDisableTool(args: any): Promise<ToolResult> {
      try {
        const { clearData = false } = args as PersistenceDisableArgs;
    
        if (!persistenceManager.isEnabled()) {
          return {
            content: [
              {
                type: 'text' as const,
                text: JSON.stringify(
                  {
                    success: false,
                    message: 'Persistence is already disabled',
                    clearData: false,
                  },
                  null,
                  2
                ),
              },
            ],
          };
        }
    
        // Get storage info before disabling (if data is being cleared)
        const storageInfo = clearData ? await persistenceManager.getStatus(true) : null;
    
        const result = await persistenceManager.disable(clearData);
    
        if (result.success) {
          return {
            content: [
              {
                type: 'text' as const,
                text: JSON.stringify(
                  {
                    success: true,
                    message: result.message,
                    clearedData: clearData,
                    previousStorageInfo: storageInfo?.storageInfo || null,
                    effect: 'XC-MCP will now operate with in-memory caching only',
                  },
                  null,
                  2
                ),
              },
            ],
          };
        } else {
          throw new McpError(
            ErrorCode.InternalError,
            `Failed to disable persistence: ${result.message}`
          );
        }
      } catch (error) {
        if (error instanceof McpError) {
          throw error;
        }
        throw new McpError(
          ErrorCode.InternalError,
          `Failed to disable persistence: ${error instanceof Error ? error.message : String(error)}`
        );
      }
    }
  • Input schema/type definition for the persistence-disable tool arguments.
    interface PersistenceDisableArgs {
      clearData?: boolean;
    }
  • Routing logic in the consolidated 'persistence' tool that delegates to the disable handler when operation='disable'.
    case 'disable':
      return persistenceDisableTool({ clearData: args.clearData ?? false });
    case 'status':
  • Registration of the consolidated 'persistence' tool, which handles 'persistence-disable' functionality via operation='disable'. Backwards compatibility docs reference 'persistence-disable'.
      server.registerTool(
        'persistence',
        {
          description: getDescription(PERSISTENCE_DOCS, PERSISTENCE_DOCS_MINI),
          inputSchema: {
            operation: z.enum(['enable', 'disable', 'status']),
            cacheDir: z.string().optional(),
            clearData: z.boolean().default(false),
            includeStorageInfo: z.boolean().default(true),
          },
          ...DEFER_LOADING_CONFIG,
        },
        async args => {
          try {
            await validateXcodeInstallation();
            // eslint-disable-next-line @typescript-eslint/no-explicit-any
            return (await persistenceTool(args)) as any;
          } catch (error) {
            if (error instanceof McpError) throw error;
            throw new McpError(
              ErrorCode.InternalError,
              `Tool execution failed: ${error instanceof Error ? error.message : String(error)}`
            );
          }
        }
      );
    }
  • Documentation string for the persistence-disable tool.
    export const PERSISTENCE_DISABLE_DOCS = `
    # persistence-disable
    
    šŸ”Œ **Disable persistent state management and return to in-memory-only caching** - Turn off persistence.
    
    Safely deactivates file-based persistence and optionally deletes existing cache data files. After disabling, XC-MCP operates with in-memory caching only, losing all learned state on server restart. Useful for privacy requirements, disk space constraints, or troubleshooting cache-related issues.
    
    ## Advantages
    
    • Meet privacy requirements that prohibit persistent storage
    • Free up disk space when storage is limited
    • Switch to CI/CD mode where persistence isn't beneficial
    • Troubleshoot issues potentially caused by stale cached data
    
    ## Parameters
    
    ### Required
    - (None)
    
    ### Optional
    - clearData (boolean): Whether to delete existing cache files when disabling. Defaults to false
    
    ## Returns
    
    - Tool execution results with persistence deactivation confirmation
    - Confirmation of whether cache files were cleared
    - Previous storage information (if clearData was true)
    - Operational effect description
    
    ## Related Tools
    
    - persistence-enable: Turn on persistence
    - persistence-status: View persistence system status
    
    ## Notes
    
    - Tool is auto-registered with MCP server
    - Defaults to keeping cache files (just stopping writes)
    - Set clearData: true to delete all cache files
    - Operation is immediate and irreversible
    `;
Behavior4/5

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

With no annotations provided, the description carries the full burden and does so effectively. It discloses key behavioral traits: the tool is safe ('Safely disables'), has an optional data-clearing parameter, and explains the consequence ('losing state on server restart'). It doesn't cover rate limits or auth needs, but for a tool with no annotations, this is strong disclosure.

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 well-structured and front-loaded with the core action, followed by supporting details and usage guidelines. Every sentence earns its place by adding clarity or context, with no redundant information. The bulleted list is efficient for readability.

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

Completeness4/5

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

Given the tool's moderate complexity (one optional parameter, no output schema, no annotations), the description is largely complete. It covers purpose, usage, behavior, and parameter context. However, it lacks details on error conditions or confirmation of success, which would be helpful for a disabling operation.

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 schema description coverage is 100%, so the baseline is 3. The description adds value by explaining the parameter's purpose in context ('optionally clears existing cache data'), which enhances understanding beyond the schema's technical description. However, it doesn't provide additional syntax or format details.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the specific action ('Disable Persistent State Management') and resource ('file-based persistence'), distinguishing it from siblings like 'persistence-enable' and 'persistence-status'. It explicitly mentions the outcome ('Return to in-memory caching only'), avoiding tautology with the tool name.

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

Usage Guidelines5/5

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

The description provides explicit guidance on when to use this tool through a bulleted list of scenarios (e.g., privacy requirements change, disk space limited, CI/CD mode, troubleshooting). It implicitly distinguishes from alternatives like 'persistence-enable' by focusing on disabling, though it doesn't explicitly name when-not-to-use cases.

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/conorluddy/xc-mcp'

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