Skip to main content
Glama
steveclarke

MCP Printer Server

by steveclarke

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
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • 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}`, }, ], } } )
  • 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}`, }, ], } } )
  • Tool metadata and empty input schema for get_default_printer.
    { title: "Get Default Printer", description: "Get the name of the default printer", inputSchema: {}, },

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/steveclarke/mcp-printer'

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