xcode_add_plist_entry
Add new entries to plist files in Xcode projects by specifying key, type, and value parameters for configuration management.
Instructions
Add a new entry to a plist file
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| plist_path | Yes | Path to the plist file | |
| key | Yes | Plist key to add | |
| 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 entry to the plist file.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)Dispatches the add_plist_entry internal command by calling FileManager.addPlistEntry.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 internal 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:137-139 (handler)MCP tool call handler that strips the 'xcode_' prefix from tool names and delegates to CommandExecutor.executeCommand.const commandName = name.startsWith('xcode_') ? name.slice(6) : name; const result = await this.commandExecutor.executeCommand(commandName, args);
- src/index.ts:87-89 (registration)Registers the tool list handler, exposing generated tools including 'xcode_add_plist_entry' via ListToolsRequestSchema.this.server.setRequestHandler(ListToolsRequestSchema, async () => ({ tools: [...tools, ...webMonitorTools], }));