show_default_settings
Show your default paper size and orientation to honor your account preferences. Use this when you haven't specified page settings to avoid relying on A4/Portrait.
Instructions
Show the user's default paper size and orientation preferences (set on their account page). Useful when the user hasn't specified pageSize/orientation explicitly — call this to honor their defaults instead of using A4/Portrait blindly.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| default_page_size | Yes | User's preferred page size | |
| default_orientation | Yes | User's preferred page orientation |
Implementation Reference
- src/tools/userSettings.ts:5-35 (handler)The actual handler function for the show_default_settings tool. Currently returns hardcoded defaults (A4, Portrait) as a placeholder since the user defaults API is not yet implemented.
export async function handleShowDefaultSettings( apiClient: MDMagicApiClient, args: any ): Promise<CallToolResult> { try { console.error('[show_default_settings] Fetching user default settings...'); // For now, return default values since we need to implement user defaults API return { content: [ { type: "text", text: `📋 **Your Default Document Settings** **📄 Default Page Size:** A4 **🔄 Default Orientation:** Portrait 💡 **How to use:** - When converting documents, these defaults are used automatically - You can override by specifying \`pageSize\` and \`orientation\` in \`convert_document\` - Available page sizes: A3, A4, Executive, US_Legal, US_Letter - Available orientations: Portrait, Landscape` } ] }; } catch (error: any) { console.error('[show_default_settings] Error:', error.message); throw error; } } - src/tools/index.ts:1-79 (registration)Unified tool registration index. Imports handleShowDefaultSettings and routes 'show_default_settings' case to it in the switch statement (lines 42-43).
// Tool registration index - UNIFIED HANDLER ARCHITECTURE import { Server } from '@modelcontextprotocol/sdk/server/index.js'; import { CallToolRequestSchema, CallToolRequest, CallToolResult } from '@modelcontextprotocol/sdk/types.js'; import { MDMagicApiClient } from '../services/apiClient.js'; import { CreditCalculator } from '../services/creditCalculator.js'; import { handleConvertDocument } from './convertDocument.js'; import { handleListAllTemplates, handleListBuiltinTemplates, handleListCustomTemplates } from './listTemplates.js'; import { handleShowDefaultSettings } from './userSettings.js'; import { handleCheckCreditBalance, handleEstimateConversionCost } from './creditTools.js'; import { handleValidateMarkdown } from './validateMarkdown.js'; import { handleGetTemplateDetails } from './getTemplateDetails.js'; import { handleRecommendTemplate } from './recommendTemplate.js'; export async function registerAllTools( server: Server, apiClient: MDMagicApiClient ): Promise<void> { console.error('🔧 Registering MCP tools with unified handler...'); // Initialize credit calculator for credit tools const creditCalculator = new CreditCalculator(apiClient); // Register a SINGLE unified handler for all tools server.setRequestHandler(CallToolRequestSchema, async (request: CallToolRequest): Promise<CallToolResult> => { const toolName = request.params.name; console.error(`[MCP] Handling tool request: ${toolName}`); try { switch (toolName) { case 'convert_document': return await handleConvertDocument(apiClient, request.params.arguments); case 'list_all_templates': return await handleListAllTemplates(apiClient, request.params.arguments); case 'list_builtin_templates': return await handleListBuiltinTemplates(apiClient, request.params.arguments); case 'list_custom_templates': return await handleListCustomTemplates(apiClient, request.params.arguments); case 'show_default_settings': return await handleShowDefaultSettings(apiClient, request.params.arguments); case 'check_credit_balance': return await handleCheckCreditBalance(creditCalculator, request.params.arguments); case 'estimate_conversion_cost': return await handleEstimateConversionCost(creditCalculator, request.params.arguments); case 'validate_markdown': return await handleValidateMarkdown(apiClient, request.params.arguments); case 'get_template_details': return await handleGetTemplateDetails(apiClient, request.params.arguments); case 'recommend_template': return await handleRecommendTemplate(apiClient, request.params.arguments); default: throw new Error(`Unknown tool: ${toolName}`); } } catch (error: any) { console.error(`[MCP] Error handling ${toolName}:`, error); return { content: [ { type: "text", text: `❌ Error: ${error.message}` } ], isError: true }; } }); console.error('✅ All MCP tools registered successfully with unified handler'); console.error('📋 Available tools: convert_document, list_all_templates, list_builtin_templates, list_custom_templates, show_default_settings, check_credit_balance, estimate_conversion_cost, validate_markdown, get_template_details, recommend_template'); } - src/index.ts:199-221 (schema)Tool definition/schema for show_default_settings including description, annotations, inputSchema (empty object - no inputs), and outputSchema (default_page_size and default_orientation). Defined in getToolDefinitions() for the ListToolsRequestSchema handler.
{ name: "show_default_settings", description: "Show the user's default paper size and orientation preferences (set on their account page). Useful when the user hasn't specified pageSize/orientation explicitly — call this to honor their defaults instead of using A4/Portrait blindly.", annotations: { title: "Show user's default page size and orientation", readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: true }, inputSchema: { type: "object" as const, properties: {} }, outputSchema: { type: "object" as const, properties: { default_page_size: { type: "string", description: "User's preferred page size" }, default_orientation: { type: "string", description: "User's preferred page orientation" } }, required: ["default_page_size", "default_orientation"] } },