Skip to main content
Glama
artem-amplemarket

Amplemarket Knowledge Base MCP Server

amplemarket_get_all_articles

Retrieve all available articles from the Amplemarket knowledge base to browse titles, IDs, and metadata before accessing specific content.

Instructions

PRIMARY TOOL: Get all articles from the Amplemarket knowledge base. Returns complete list of article titles, IDs, and metadata. Use this first to browse available articles, then use amplemarket_get_article to get full content of specific articles. No search needed - this shows everything available.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The main handler function that fetches all Amplemarket KB articles using PylonAPI, filters published/unpublished, maps to metadata, and returns formatted JSON response.
    export async function handleKbGetArticles(pylonClient: PylonAPI, args: unknown) {
      try {
        const articles = await pylonClient.getAmplemarketArticles();
        
        // Separate published and unpublished articles
        const publishedArticles = articles.filter(article => article.is_published);
        const unpublishedArticles = articles.filter(article => !article.is_published);
        
        // Return only essential metadata to avoid response size limits
        const mapArticle = (article: any) => ({
          id: article.id,
          title: article.title,
          slug: article.slug,
          identifier: article.identifier,
          is_published: article.is_published,
          last_published_at: article.last_published_at,
          // Exclude the large current_published_content_html field
        });
        
        const publishedData = publishedArticles.map(mapArticle);
        const unpublishedData = unpublishedArticles.map(mapArticle);
        
        return {
          content: [
            {
              type: 'text',
              text: JSON.stringify({
                summary: {
                  total: articles.length,
                  published_count: publishedArticles.length,
                  unpublished_count: unpublishedArticles.length,
                  knowledge_base: 'Amplemarket Knowledge Base'
                },
                published_articles: publishedData,
                unpublished_articles: unpublishedData,
                note: 'Full article content not included - use amplemarket_get_article for specific article content'
              }, null, 2)
            }
          ]
        };
      } catch (error) {
        return {
          content: [
            {
              type: 'text',
              text: `Error getting Amplemarket articles: ${error instanceof Error ? error.message : 'Unknown error'}`
            }
          ],
          isError: true
        };
      }
    }
  • Tool schema defining name, description, and empty input schema (no parameters required).
    export const kbGetArticlesTool: Tool = {
      name: 'amplemarket_get_all_articles',
      description: 'PRIMARY TOOL: Get all articles from the Amplemarket knowledge base. Returns complete list of article titles, IDs, and metadata. Use this first to browse available articles, then use amplemarket_get_article to get full content of specific articles. No search needed - this shows everything available.',
      inputSchema: {
        type: 'object',
        properties: {},
        additionalProperties: false
      }
    };
  • src/index.ts:51-52 (registration)
    Registration of the tool handler in the MCP server's CallToolRequestSchema handler switch statement.
    case 'amplemarket_get_all_articles':
      return await handleKbGetArticles(pylonClient, request.params.arguments);
  • src/index.ts:39-43 (registration)
    Registration of the tool in the ListToolsRequestSchema handler, making it discoverable by MCP clients.
    server.setRequestHandler(ListToolsRequestSchema, async () => {
      return {
        tools: [kbGetArticleTool, kbGetCollectionTool, kbGetArticlesTool],
      };
    });

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