get_shortcuts
Query keyboard shortcuts for operating systems and applications using natural language. Specify OS and your shortcut question to get relevant key combinations.
Instructions
Query keyboard shortcuts for a specific OS, desktop environment, and/or application. Uses Claude Opus to intelligently search and return relevant shortcuts based on natural language queries.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| application | No | Specific application (e.g., firefox, tmux) - optional | |
| desktop | No | Desktop environment (e.g., gnome, kde) - optional | |
| os | Yes | Operating system (e.g., ubuntu, macos, windows) | |
| query | Yes | Natural language query about keyboard shortcuts (e.g., "how do I split a pane vertically?") |
Input Schema (JSON Schema)
{
"properties": {
"application": {
"description": "Specific application (e.g., firefox, tmux) - optional",
"type": "string"
},
"desktop": {
"description": "Desktop environment (e.g., gnome, kde) - optional",
"type": "string"
},
"os": {
"description": "Operating system (e.g., ubuntu, macos, windows)",
"type": "string"
},
"query": {
"description": "Natural language query about keyboard shortcuts (e.g., \"how do I split a pane vertically?\")",
"type": "string"
}
},
"required": [
"os",
"query"
],
"type": "object"
}
Implementation Reference
- src/handlers.ts:4-38 (handler)The core handler function that filters shortcut data by OS, desktop, and application parameters, queries the Opus client with the natural language query to find relevant shortcuts, and returns a structured text response.export async function handleGetShortcuts( params: GetShortcutsParams, dataStore: DataStore, opusClient: OpusClient ): Promise<{ content: Array<{ type: string; text: string }> }> { // Filter data based on parameters const relevantData = dataStore.getByFilters({ os: params.os, desktop: params.desktop, application: params.application, }); if (relevantData.length === 0) { return { content: [ { type: 'text', text: `No shortcut data found for: OS=${params.os}${params.desktop ? `, Desktop=${params.desktop}` : ''}${params.application ? `, App=${params.application}` : ''}`, }, ], }; } // Query Opus with filtered data const response = await opusClient.queryShortcuts(params.query, relevantData); return { content: [ { type: 'text', text: response, }, ], }; }
- src/index.ts:44-69 (registration)Registration of the 'get_shortcuts' tool in the ListToolsRequestHandler, including name, description, and JSON input schema.{ name: 'get_shortcuts', description: 'Query keyboard shortcuts for a specific OS, desktop environment, and/or application. Uses Claude Opus to intelligently search and return relevant shortcuts based on natural language queries.', inputSchema: { type: 'object', properties: { os: { type: 'string', description: 'Operating system (e.g., ubuntu, macos, windows)', }, query: { type: 'string', description: 'Natural language query about keyboard shortcuts (e.g., "how do I split a pane vertically?")', }, desktop: { type: 'string', description: 'Desktop environment (e.g., gnome, kde) - optional', }, application: { type: 'string', description: 'Specific application (e.g., firefox, tmux) - optional', }, }, required: ['os', 'query'], }, },
- src/index.ts:20-25 (schema)Zod schema for input validation of GetShortcutsParams used when handling tool calls.const GetShortcutsParamsSchema = z.object({ os: z.string().describe('Operating system (e.g., ubuntu, macos, windows)'), query: z.string().describe('Natural language query about keyboard shortcuts'), desktop: z.string().optional().describe('Desktop environment (e.g., gnome, kde)'), application: z.string().optional().describe('Specific application (e.g., firefox, tmux)'), });
- src/types.ts:21-26 (schema)TypeScript interface defining the shape of GetShortcutsParams.export interface GetShortcutsParams { os: string; query: string; desktop?: string; application?: string; }
- src/index.ts:76-79 (registration)Dispatch logic in CallToolRequestHandler that routes 'get_shortcuts' calls to the handler after schema validation.if (request.params.name === 'get_shortcuts') { const params = GetShortcutsParamsSchema.parse(request.params.arguments) as GetShortcutsParams; return handleGetShortcuts(params, dataStore, opusClient); }