Skip to main content
Glama

get_archive

Retrieve New York Times articles from monthly archives by specifying year and month parameters to access historical content.

Instructions

Get New York Times articles from a specific month and year archive.

Args: year: Year (default: current year) month: Month 1-12 (default: current month)

Returns: Full NYT archive API response (unformatted)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
yearNo
monthNo

Implementation Reference

  • Core handler function that implements the get_archive tool logic by fetching the NYT archive API response for the specified year and month using the shared NytClient.
    async def get_archive(year: int | None = None, month: int | None = None) -> dict: """ Get New York Times articles from a specific month and year archive. Args: year: Year (default: current year) month: Month 1-12 (default: current month) Returns: Full NYT archive API response (unformatted) """ now = datetime.now() year = year or now.year month = month or now.month client = get_client() response = await client.make_nyt_request(f"archive/v1/{year}/{month}.json", {}) # Return raw response (no formatting for archive) return response
  • MCP tool registration for get_archive using FastMCP's @mcp.tool() decorator. This wrapper function defines the tool schema via type hints and docstring, and delegates execution to the core handler in tools.py.
    @mcp.tool() async def get_archive(year: int | None = None, month: int | None = None) -> dict: """ Get New York Times articles from a specific month and year archive. Args: year: Year (default: current year) month: Month 1-12 (default: current month) Returns: Full NYT archive API response (unformatted) """ return await tools.get_archive(year, month)

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/jeffmm/nytimes-mcp'

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