Skip to main content
Glama

article

Fetch Zenn.dev articles by author, topic, or date order to access technical content and documentation.

Instructions

Fetch articles from Zenn.dev

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
usernameNoUsername of the article author
topicnameNoTopic name of the article
orderNoOrder of the articles. Choose from latest or oldest
pageNoPage number of the articles. Default: 1
countNoNumber of articles per page. Default: 48

Implementation Reference

  • Specific handler function for the 'article' tool. It converts the input arguments dictionary into an Article model instance and calls fetch_articles to retrieve data from Zenn.dev API.
    async def handle_articles(arguments: dict) -> dict: query = Article.from_arguments(arguments) return await fetch_articles(query)
  • Defines the input schema for the 'article' tool using Pydantic model fields, returned as a Tool object for MCP registration.
    def tool() -> Tool: return Tool( name=ZennTool.ARTICLE.value, description="Fetch articles from Zenn.dev", inputSchema={ "type": "object", "properties": { "username": {"type": "string", "description": Article.model_fields["username"].description}, "topicname": {"type": "string", "description": Article.model_fields["topicname"].description}, "order": { "type": "string", "description": Article.model_fields["order"].description, "enum": [Order.LATEST.value, Order.OLDEST.value], }, "page": {"type": "integer", "description": Article.model_fields["page"].description}, "count": {"type": "integer", "description": Article.model_fields["count"].description}, }, "required": [], }, )
  • Registers the 'article' tool with the MCP server by including its Tool schema in the list_tools response.
    @server.list_tools() async def list_tools() -> list[Tool]: return [Article.tool(), Book.tool()]
  • Main MCP tool call handler decorated with @server.call_tool(). Dispatches 'article' tool calls to the specific handle_articles function and formats the JSON response as TextContent.
    @server.call_tool() async def call_tool( name: str, arguments: dict, ) -> Sequence[TextContent | ImageContent | EmbeddedResource]: try: logger.debug(f"Calling tool: {name} with arguments: {arguments}") match name: case ZennTool.ARTICLE.value: result = await handle_articles(arguments) case ZennTool.BOOK.value: result = await handle_books(arguments) case _: raise ValueError(f"Unknown tool: {name}") return [TextContent(type="text", text=json.dumps(result, indent=2, ensure_ascii=False))] except Exception as e: logger.error(f"Error processing {APP_NAME} query: {str(e)}") raise ValueError(f"Error processing {APP_NAME} query: {str(e)}")
  • Helper function that performs the HTTP request to fetch articles from Zenn.dev API using the query parameters derived from the Article model.
    async def fetch_articles(query: Article) -> dict: return await request(URLResource.ARTICLES, query.to_query_param())
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/shibuiwilliam/mcp-server-zenn'

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