Skip to main content
Glama

get_blog_post_content

Retrieve complete content from any blog post URL by specifying the link, enabling direct access to detailed information for analysis or integration.

Instructions

Get the full content of a specific blog post by URL

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
urlYesThe URL of the blog post to retrieve content from

Implementation Reference

  • The MCP tool handler function for 'get_blog_post_content'. It processes the input URL, fetches blog post content using the helper, formats the result or error as MCP-standard content blocks, and returns it.
    async ({ url }) => { try { const result = await fetchBlogPostContent(url); return { content: [ { type: "text", text: JSON.stringify( { url: result.url, title: result.title, content: result.content, metadata: result.metadata, contentLength: result.contentLength, }, null, 2, ), }, ], }; } catch (error) { return { content: [ { type: "text", text: JSON.stringify( { error: "Failed to retrieve blog post content", message: error instanceof Error ? error.message : "Unknown error", }, null, 2, ), }, ], isError: true, }; }
  • Input schema using Zod for URL validation, along with tool title and description used in MCP tool registration.
    const urlSchema = z.string().url() as any; /** * Register the get blog post content tool */ export function registerGetBlogPostContentTool(server: McpServer) { server.registerTool( "get_blog_post_content", { title: "Get Blog Post Content", description: "Get the full content of a specific blog post by URL. Extracts article text, title, and metadata (author, publish date, tags) from blog.duyet.net or duyet.net posts.", inputSchema: { url: urlSchema.describe( "The URL of the blog post to retrieve content from (blog.duyet.net or duyet.net)", ), },
  • The registerGetBlogPostContentTool function that calls server.registerTool to register the 'get_blog_post_content' tool with its schema and handler.
    export function registerGetBlogPostContentTool(server: McpServer) { server.registerTool( "get_blog_post_content", { title: "Get Blog Post Content", description: "Get the full content of a specific blog post by URL. Extracts article text, title, and metadata (author, publish date, tags) from blog.duyet.net or duyet.net posts.", inputSchema: { url: urlSchema.describe( "The URL of the blog post to retrieve content from (blog.duyet.net or duyet.net)", ), }, }, async ({ url }) => { try { const result = await fetchBlogPostContent(url); return { content: [ { type: "text", text: JSON.stringify( { url: result.url, title: result.title, content: result.content, metadata: result.metadata, contentLength: result.contentLength, }, null, 2, ), }, ], }; } catch (error) { return { content: [ { type: "text", text: JSON.stringify( { error: "Failed to retrieve blog post content", message: error instanceof Error ? error.message : "Unknown error", }, null, 2, ), }, ], isError: true, }; } }, ); }
  • The call to registerGetBlogPostContentTool within the main registerAllTools function, including logging confirmation.
    registerGetBlogPostContentTool(server); logger.tool("get_blog_post_content", "registered");
  • Cached wrapper for fetching and parsing individual blog post content (title, article text, metadata) from blog.duyet.net/duyet.net URLs, used by the tool handler. Delegates to uncached internal implementation.
    export async function fetchBlogPostContent(url: string): Promise<{ url: string; title: string | null; content: string; metadata: { author?: string; publishDate?: string; tags?: string[]; }; contentLength: number; }> { // Use URL as cache key (normalized) const cacheKey = `blog-post-${encodeURIComponent(url)}`; return cacheOrFetch( cacheKey, CACHE_CONFIGS.BLOG, () => fetchBlogPostContentInternal(url), ); }

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

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