Skip to main content
Glama

guardian_get_sections

Retrieve all available Guardian newspaper sections to browse and access content categories from the complete archives.

Instructions

Get all available Guardian sections

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The core handler function that executes the guardian_get_sections tool: calls client.getSections() and formats the results.
    export async function guardianGetSections(client: GuardianClient, args: any): Promise<string> { const response = await client.getSections(); const sections = response.response.results; return formatSectionsResponse(sections); }
  • The input schema definition (empty properties since no parameters needed) for the tool as registered in the MCP server.
    { name: 'guardian_get_sections', description: 'Get all available Guardian sections', inputSchema: { type: 'object', properties: {}, }, },
  • The registration mapping of the tool name to its handler function within the registerTools utility.
    guardian_get_sections: (args) => guardianGetSections(client, args),
  • Supporting utility function that formats the raw sections data into a user-readable markdown list.
    export function formatSectionsResponse(sections: GuardianSection[]): string { if (!sections || sections.length === 0) { return 'No sections found.'; } let result = 'Available Guardian sections:\n\n'; sections.forEach((section) => { result += `**${section.webTitle || 'Unknown'}**\n`; result += `ID: ${section.id || 'N/A'}\n`; result += `URL: ${section.webUrl || 'N/A'}\n\n`; }); return result; }

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/jbenton/guardian-mcp-server'

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