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
| Name | Required | Description | Default |
|---|---|---|---|
| key | Yes | Plist key to add | |
| plist_path | Yes | Path to the plist file | |
| type | Yes | Value type (string, bool, integer, array, dict) | |
| value | Yes | Value to add |
Implementation Reference
- src/file-manager.ts:61-64 (handler)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); }
- src/command-executor.ts:196-199 (handler)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;
- src/command-executor.ts:281-306 (registration)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) : [] } })); }
- src/index.ts:135-140 (handler)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], }));