Skip to main content
Glama

get_templates

Retrieve a list of available resume templates with details like template ID, name, and thumbnail, enabling users to select the most suitable style for their CV.

Instructions

获取所有可用的简历模板,返回模板列表及其详细信息,包括模板ID、名称、缩略图等。帮助用户选择最适合的简历风格。

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • src/index.ts:201-227 (registration)
    Registration of the MCP tool 'get_templates' with description, empty input schema {}, and inline handler function that calls the service method and returns formatted content.
    server.tool( "get_templates", "获取所有可用的简历模板,返回模板列表及其详细信息,包括模板ID、名称、缩略图等。帮助用户选择最适合的简历风格。", {}, async (_, extra) => { try { const templates = await novaCVService.getTemplates(); return { content: [ { type: "text", text: safeStringify(templates) } ], }; } catch (error: any) { return { content: [ { type: "text", text: `错误: ${error.message || "未知错误"}` } ], }; } } );
  • Core handler logic in NovaCVService.getTemplates() that makes the API request to retrieve the list of available templates.
    async getTemplates(): Promise<any> { try { const response = await this.client.get('/api/v1/templates'); return response.data; } catch (error) { this._handleError(error); throw error; } }
  • Helper function safeStringify used in the tool handler to safely convert API responses to strings for MCP content.
    const safeStringify = (data: any): string => { try { // 特别处理API错误响应 if (data && data.error) { return `API错误: ${data.error.message || JSON.stringify(data.error)}`; } // 处理标准成功响应 if (data && data.success === true && data.data) { const responseData = data.data; if (responseData.fileUrl) { return `简历生成成功,下载地址: ${responseData.fileUrl}`; } } // 默认JSON字符串化 return JSON.stringify(data, null, 2); } catch (err) { return "API返回了结果,但无法转换为字符串展示(可能包含循环引用)"; } };
  • Input schema for 'get_templates' tool: empty object indicating no parameters required.
    {},

Other Tools

Related Tools

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/HireTechUpUp/mcp-server-novacv'

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