Skip to main content
Glama

Get Blog Post Content

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));
    }
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It describes what the tool does (extracts content and metadata) but lacks details on error handling, rate limits, authentication needs, or output format, leaving gaps in behavioral context.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is front-loaded and efficient with two sentences that directly convey the tool's purpose and scope without any wasted words, making it easy to understand quickly.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's moderate complexity (single parameter, no output schema, no annotations), the description is adequate but incomplete. It covers the purpose and domain constraints but lacks details on output structure, error cases, or behavioral traits, which are needed for full contextual understanding.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already documents the 'url' parameter fully. The description adds minimal value by reiterating the domain constraints but does not provide additional syntax or format details beyond what the schema specifies.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the specific action ('Get the full content'), resource ('blog post'), and scope ('by URL'), distinguishing it from siblings like web-fetch or web-search by specifying extraction of article text, title, and metadata from specific domains (blog.duyet.net or duyet.net).

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It provides clear context for when to use this tool (to extract content from specific blog domains) but does not explicitly mention when not to use it or name alternatives among siblings, such as web-fetch for general URL fetching or web-search for broader searches.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other 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