Skip to main content
Glama

like_article

Enable users to like specific articles on Emlog blogs by submitting the article ID, liker’s name, and avatar URL via the Emlog MCP Server interface.

Instructions

Like an article

Input Schema

NameRequiredDescriptionDefault
avatarNoAvatar URL of the person liking
gidYesThe ID of the article to like
nameNoName of the person liking

Input Schema (JSON Schema)

{ "$schema": "http://json-schema.org/draft-07/schema#", "additionalProperties": false, "properties": { "avatar": { "description": "Avatar URL of the person liking", "type": "string" }, "gid": { "description": "The ID of the article to like", "type": "number" }, "name": { "description": "Name of the person liking", "type": "string" } }, "required": [ "gid" ], "type": "object" }

Implementation Reference

  • MCP tool handler: destructures input params, calls emlogClient.likeArticle(), returns success message or error.
    async ({ gid, name, avatar }) => { try { await emlogClient.likeArticle(gid, name, avatar); return { content: [{ type: "text", text: `Successfully liked article with ID: ${gid}` }] }; } catch (error) { return { content: [{ type: "text", text: `Error: ${error instanceof Error ? error.message : String(error)}` }], isError: true }; } }
  • Input schema using Zod: gid (number, required), name/avatar (string, optional).
    inputSchema: { gid: z.number().describe("The ID of the article to like"), name: z.string().optional().describe("Name of the person liking"), avatar: z.string().optional().describe("Avatar URL of the person liking") }
  • src/index.ts:357-387 (registration)
    Registration of the 'like_article' tool with McpServer using title, description, inputSchema, and handler function.
    server.registerTool( "like_article", { title: "Like Article", description: "Like an article", inputSchema: { gid: z.number().describe("The ID of the article to like"), name: z.string().optional().describe("Name of the person liking"), avatar: z.string().optional().describe("Avatar URL of the person liking") } }, async ({ gid, name, avatar }) => { try { await emlogClient.likeArticle(gid, name, avatar); return { content: [{ type: "text", text: `Successfully liked article with ID: ${gid}` }] }; } catch (error) { return { content: [{ type: "text", text: `Error: ${error instanceof Error ? error.message : String(error)}` }], isError: true }; } } );
  • EmlogClient helper method: sends POST to /index.php?action=addlike with gid, optional name/avatar, returns like id.
    async likeArticle(gid: number, name?: string, avatar?: string): Promise<{ id: number }> { const formData = new URLSearchParams(); formData.append('gid', String(gid)); if (name) formData.append('name', name); if (avatar) formData.append('avatar', avatar); const response = await this.api.post('/index.php?action=addlike', formData); return response.data.data; }

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/eraincc/emlog-mcp'

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