set_default_printer
Set a specific printer as the default printing device for your macOS or Linux system using the CUPS printing system.
Instructions
Set a printer as the default printer
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| printer | Yes | Printer name to set as default |
Implementation Reference
- src/tools/printer.ts:210-220 (handler)Handler function that sets the default printer using the `lpoptions -d` command and returns a confirmation message.async ({ printer }) => { await execa("lpoptions", ["-d", printer]) return { content: [ { type: "text", text: `✓ Set default printer to: ${printer}`, }, ], } }
- src/tools/printer.ts:206-208 (schema)Input schema defining the required 'printer' parameter as a string.inputSchema: { printer: z.string().describe("Printer name to set as default"), },
- src/tools/printer.ts:200-222 (registration)Conditional registration of the 'set_default_printer' tool with the MCP server, including title, description, input schema, and handler. Only registered if management operations are enabled in config.if (config.enableManagement) { server.registerTool( "set_default_printer", { title: "Set Default Printer", description: "Set a printer as the default printer", inputSchema: { printer: z.string().describe("Printer name to set as default"), }, }, async ({ printer }) => { await execa("lpoptions", ["-d", printer]) return { content: [ { type: "text", text: `✓ Set default printer to: ${printer}`, }, ], } } ) }
- src/tools/index.ts:22-22 (registration)High-level registration call to registerPrinterTools, which includes the set_default_printer tool.registerPrinterTools(server)