Skip to main content
Glama
kazuph
by kazuph

pocket_get_articles

Retrieve unread articles from Pocket API, providing article ID, title, URL, and excerpt. Specify the number of articles to fetch (1-20) and integrate them into Claude via MCP server.

Instructions

Fetches the latest unread articles from Pocket API. Returns up to 20 articles by default. You can specify the number of articles to fetch (1-20) using the count parameter. Returns the article ID, title, URL, and excerpt for each article.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
countNo

Implementation Reference

  • index.ts:84-126 (handler)
    Main execution logic for the 'pocket_get_articles' tool: validates input, calls getPocketList helper, formats and returns article list or error.
    case "pocket_get_articles": {
    	if (!config.pocket) {
    		throw new Error("Pocket API configuration is not available");
    	}
    
    	const parsed = GetPocketArticlesSchema.safeParse(args);
    	if (!parsed.success) {
    		throw new Error(
    			`Invalid arguments for pocket_get_articles: ${parsed.error}`,
    		);
    	}
    	try {
    		const articles = await getPocketList(
    			config.pocket,
    			parsed.data.count,
    		);
    		return {
    			content: [
    				{
    					type: "text",
    					text: articles
    						.map(
    							(article) =>
    								`ID: ${article.id}\nTitle: ${article.title}\nURL: ${article.url}\nExcerpt: ${article.excerpt}\n`,
    						)
    						.join("\n---\n"),
    				},
    			],
    		};
    	} catch (error) {
    		const errorMessage =
    			error instanceof Error ? error.message : String(error);
    		return {
    			content: [
    				{
    					type: "text",
    					text: `Pocket API Error: ${errorMessage}`,
    				},
    			],
    			isError: true,
    		};
    	}
    }
  • Zod schema for input validation of pocket_get_articles tool (optional count parameter, default 20).
    const GetPocketArticlesSchema = z.object({
    	count: z.number().optional().default(20),
    });
  • index.ts:61-67 (registration)
    Tool registration definition: name, description, and input schema for listTools response.
    	name: "pocket_get_articles",
    	description:
    		"Fetches the latest unread articles from Pocket API. Returns up to 20 articles by default. " +
    		"You can specify the number of articles to fetch (1-20) using the count parameter. " +
    		"Returns the article ID, title, URL, and excerpt for each article.",
    	inputSchema: zodToJsonSchema(GetPocketArticlesSchema) as ToolInput,
    },
  • Core helper function that makes API call to Pocket to retrieve unread articles, processes response into simplified format.
    export async function getPocketList(config: PocketConfig, count = 20) {
    	const response = await fetch("https://getpocket.com/v3/get", {
    		method: "POST",
    		headers: {
    			"Content-Type": "application/json; charset=UTF-8",
    			"X-Accept": "application/json",
    		},
    		body: JSON.stringify({
    			consumer_key: config.consumerKey,
    			access_token: config.accessToken,
    			count: Math.min(count, 20),
    			sort: "newest",
    			detailType: "complete",
    			state: "unread", // 未読の記事のみを取得
    		}),
    	});
    
    	if (!response.ok) {
    		throw new Error(`Pocket API request failed: ${response.statusText}`);
    	}
    
    	const data = (await response.json()) as PocketResponse;
    	const filteredList = Object.values(data.list).map((item) => ({
    		id: item.item_id,
    		title: item.resolved_title || item.given_title || "",
    		url: item.resolved_url || "",
    		excerpt: item.excerpt || "",
    	}));
    
    	return filteredList;
    }
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. It discloses key behavioral traits: it's a read operation (implied by 'fetches'), returns up to 20 articles by default, and specifies the return format. However, it lacks details on authentication needs, rate limits, or error handling.

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 efficiently structured with three sentences: the first states the purpose, the second explains the parameter, and the third details the return format. Each sentence adds essential information without redundancy.

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 no annotations and no output schema, the description provides adequate coverage for a simple read tool. It explains the parameter and return format, but could be more complete by addressing authentication or error scenarios, which are common for API tools.

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

Parameters4/5

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

The description adds significant meaning beyond the input schema, which has 0% description coverage. It explains the 'count' parameter's purpose (number of articles to fetch), range (1-20), and default value (20), compensating well for the schema's lack of documentation.

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

Purpose4/5

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

The description clearly states the action ('fetches') and resource ('latest unread articles from Pocket API'), making the purpose immediately understandable. However, it doesn't explicitly differentiate from the sibling tool 'pocket_mark_as_read' beyond the different action verbs.

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

Usage Guidelines3/5

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

The description implies usage context by specifying it fetches 'latest unread articles,' suggesting this is for retrieving new content rather than managing read status. However, it doesn't provide explicit guidance on when to use this versus the sibling tool or any alternatives.

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

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/kazuph/mcp-pocket'

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