Skip to main content
Glama

get_blog_post_content

Extract article content, title, author, publish date, and tags from blog.duyet.net or duyet.net posts using a URL.

Instructions

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.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
urlYesThe URL of the blog post to retrieve content from (blog.duyet.net or duyet.net)

Implementation Reference

  • The handler function implementing the tool logic. It fetches the blog post content via `fetchBlogPostContent`, formats it as JSON in a text content block, and handles errors similarly.
    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 input schema for the tool, validating the 'url' parameter as a valid URL using Zod.
    inputSchema: { url: urlSchema.describe( "The URL of the blog post to retrieve content from (blog.duyet.net or duyet.net)", ), },
  • The registration function that registers the 'get_blog_post_content' tool with the MCP server, including 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, }; } }, ); }
  • Top-level call to register the tool during all tools registration.
    registerGetBlogPostContentTool(server); logger.tool("get_blog_post_content", "registered");
  • Helper function called by the handler to fetch and cache the blog post content from the given URL.
    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)); }

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