get_configuration
Retrieve server configuration settings for the MonkeyType MCP Server to access typing test data, user profiles, leaderboards, and statistics.
Instructions
Get server configuration
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- server.js:503-508 (handler)The handler for the 'get_configuration' tool. It calls the MonkeyType API endpoint '/configuration' using the shared callMonkeyTypeApi helper and returns the JSON-formatted result.case "get_configuration": { const result = await callMonkeyTypeApi('/configuration', 'GET', apiKey); return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }], }; }
- server.js:102-102 (schema)Zod schema definition for the 'get_configuration' tool input, which extends BaseApiSchema and requires no parameters.const GetConfigurationSchema = BaseApiSchema.extend({});
- server.js:270-274 (registration)Registration of the 'get_configuration' tool in the listTools response, including name, description, and input schema.{ name: "get_configuration", description: "Get server configuration", inputSchema: zodToJsonSchema(GetConfigurationSchema), },
- server.js:118-156 (helper)Shared helper function used by the 'get_configuration' handler (and all other tools) to make authenticated API calls to the MonkeyType server.async function callMonkeyTypeApi(endpoint, method, apiKey, params = {}, data = null) { try { const headers = { 'Authorization': `ApeKey ${apiKey}`, 'Content-Type': 'application/json', 'User-Agent': 'MonkeyType-MCP-Server/1.0.0' }; const config = { headers, timeout: 30000, validateStatus: status => status < 500 }; if (method === 'GET' && Object.keys(params).length > 0) { config.params = params; } let response; if (method === 'GET') { response = await axios.get(`${MONKEYTYPE_API_BASE_URL}${endpoint}`, config); } else if (method === 'POST') { response = await axios.post(`${MONKEYTYPE_API_BASE_URL}${endpoint}`, data, config); } return response.data; } catch (error) { console.error(`Error calling MonkeyType API: ${error.message}`); if (error.response) { return { error: error.response.data, statusCode: error.response.status }; } return { error: error.message }; } }