Skip to main content
Glama
artem-amplemarket

Amplemarket Knowledge Base MCP Server

amplemarket_get_article

Retrieve specific articles from the Amplemarket knowledge base using article ID or slug to access detailed content and information.

Instructions

Get a specific article from the Amplemarket knowledge base by ID or slug

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idNoArticle ID (provide either id or slug)
slugNoArticle slug (provide either id or slug)

Implementation Reference

  • The asynchronous handler function that implements the core logic of the 'amplemarket_get_article' tool. It parses the input arguments, fetches the article from the Pylon API using either ID or slug, and returns the article as formatted JSON or an error message.
    export async function handleKbGetArticle(pylonClient: PylonAPI, args: unknown) { const params = GetArticleParamsSchema.parse(args); try { let article; if (params.id) { article = await pylonClient.getArticleById(params.id); } else if (params.slug) { article = await pylonClient.getArticleBySlug(params.slug); } else { throw new Error('Either id or slug must be provided'); } return { content: [ { type: 'text', text: JSON.stringify(article, null, 2) } ] }; } catch (error) { return { content: [ { type: 'text', text: `Error getting article: ${error instanceof Error ? error.message : 'Unknown error'}` } ], isError: true }; } }
  • The tool definition object 'kbGetArticleTool' that specifies the name, description, and input schema for the MCP tool.
    export const kbGetArticleTool: Tool = { name: 'amplemarket_get_article', description: 'Get a specific article from the Amplemarket knowledge base by ID or slug', inputSchema: { type: 'object', properties: { id: { type: 'string', description: 'Article ID (provide either id or slug)' }, slug: { type: 'string', description: 'Article slug (provide either id or slug)' } }, additionalProperties: false } };
  • Zod schema 'GetArticleParamsSchema' used in the handler for input validation, ensuring either 'id' or 'slug' is provided.
    export const GetArticleParamsSchema = z.object({ id: z.string().optional(), slug: z.string().optional() }).refine( (data) => data.id || data.slug, { message: "Either 'id' or 'slug' must be provided", path: ["id"] } );
  • src/index.ts:39-43 (registration)
    Registration of the tool in the MCP server's ListTools request handler by including 'kbGetArticleTool' in the returned tools list.
    server.setRequestHandler(ListToolsRequestSchema, async () => { return { tools: [kbGetArticleTool, kbGetCollectionTool, kbGetArticlesTool], }; });
  • src/index.ts:45-56 (registration)
    Dispatch registration in the MCP server's CallTool request handler, mapping 'amplemarket_get_article' to the 'handleKbGetArticle' function.
    server.setRequestHandler(CallToolRequestSchema, async (request) => { switch (request.params.name) { case 'amplemarket_get_article': return await handleKbGetArticle(pylonClient, request.params.arguments); case 'kb_get_collection': return await handleKbGetCollection(pylonClient, request.params.arguments); case 'amplemarket_get_all_articles': return await handleKbGetArticles(pylonClient, request.params.arguments); default: throw new Error(`Unknown tool: ${request.params.name}`); } });

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/artem-amplemarket/amplemarket-pylon-mcp'

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