get_default_printer
Retrieve the name of the default printer configured on your macOS or Linux system using the CUPS printing system.
Instructions
Get the name of the default printer
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/tools/printer.ts:137-149 (handler)Handler function that runs 'lpstat -d' to retrieve the default printer name and formats the response.async () => { const output = await execCommand("lpstat", ["-d"]) const defaultPrinter = output.split(": ")[1] || "No default printer set" return { content: [ { type: "text", text: `Default printer: ${defaultPrinter}`, }, ], } } )
- src/tools/printer.ts:130-149 (registration)Registration of the 'get_default_printer' tool including title, description, empty input schema, and inline handler.server.registerTool( "get_default_printer", { title: "Get Default Printer", description: "Get the name of the default printer", inputSchema: {}, }, async () => { const output = await execCommand("lpstat", ["-d"]) const defaultPrinter = output.split(": ")[1] || "No default printer set" return { content: [ { type: "text", text: `Default printer: ${defaultPrinter}`, }, ], } } )
- src/tools/printer.ts:132-136 (schema)Tool metadata and empty input schema for get_default_printer.{ title: "Get Default Printer", description: "Get the name of the default printer", inputSchema: {}, },