Skip to main content
Glama
ebowwa
by ebowwa

xcode_add_plist_entry

Add or modify a specific entry in a plist file by specifying the path, key, value type, and value. Essential for managing iOS/macOS project configurations programmatically.

Instructions

Add a new entry to a plist file

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
keyYesPlist key to add
plist_pathYesPath to the plist file
typeYesValue type (string, bool, integer, array, dict)
valueYesValue to add

Implementation Reference

  • Core handler function that executes the PlistBuddy command to add a new plist entry with specified key, type, and value.
    async addPlistEntry(plistPath: string, key: string, type: string, value: string): Promise<void> { const command = `/usr/libexec/PlistBuddy -c "Add :${key} ${type} ${value}" "${plistPath}"`; await execAsync(command); }
  • Internal command dispatcher in executeInternalCommand that invokes fileManager.addPlistEntry and sets success output for 'add_plist_entry'.
    case 'add_plist_entry': await this.fileManager.addPlistEntry(args.plist_path, args.key, args.type, args.value); output = `Plist entry added successfully: ${args.key} = ${args.value}`; break;
  • Generates the MCP tool list including 'xcode_add_plist_entry' by prefixing command names with 'xcode_' and deriving inputSchema from command parameters.
    generateMCPToolDefinitions(): Array<{ name: string; description: string; inputSchema: any; }> { return Object.entries(this.commands).map(([name, command]) => ({ name: `xcode_${name}`, description: command.description, inputSchema: { type: 'object', properties: command.parameters ? Object.fromEntries( Object.entries(command.parameters).map(([paramName, paramDef]) => [ paramName, { type: paramDef.type, description: paramDef.description, ...(paramDef.default !== undefined && { default: paramDef.default }) } ]) ) : {}, required: command.parameters ? Object.entries(command.parameters) .filter(([_, paramDef]) => paramDef.required) .map(([paramName]) => paramName) : [] } })); }
  • MCP server CallToolRequest handler that maps tool name 'xcode_add_plist_entry' to internal command 'add_plist_entry' by removing prefix and calling executeCommand.
    // Handle Xcode commands // Remove 'xcode_' prefix if present const commandName = name.startsWith('xcode_') ? name.slice(6) : name; const result = await this.commandExecutor.executeCommand(commandName, args); let responseText = result.output;
  • src/index.ts:87-89 (registration)
    Registers the ListTools handler that returns the list of tools including those generated by commandExecutor.generateMCPToolDefinitions() containing 'xcode_add_plist_entry'.
    this.server.setRequestHandler(ListToolsRequestSchema, async () => ({ tools: [...tools, ...webMonitorTools], }));

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/ebowwa/xcode-mcp'

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