Skip to main content
Glama
jwaresolutions

Polygon MCP Server

get_market_status

Check if financial markets are open or closed to determine trading availability and schedule planning.

Instructions

Check if markets are open

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The async handler function for the 'get_market_status' tool. It fetches the current market status from the Polygon API endpoint '/v1/marketstatus/now', formats the response as JSON text, and handles errors appropriately.
    get_market_status: async () => { try { const response = await polygonApi.get('/v1/marketstatus/now'); return { content: [{ type: "text", text: JSON.stringify(response.data, null, 2) }] }; } catch (error: any) { return { content: [{ type: "text", text: `Error getting market status: ${error.response?.data?.message || error.message}` }], isError: true }; } },
  • The input schema definition for the 'get_market_status' tool as provided in the ListTools response. It specifies no required input parameters.
    { name: "get_market_status", description: "Check if markets are open", inputSchema: { type: "object", properties: {} } },
  • src/index.ts:402-410 (registration)
    The CallToolRequestHandler registration where tool names like 'get_market_status' are dynamically dispatched to their handlers in the toolHandlers object.
    server.setRequestHandler(CallToolRequestSchema, async (request) => { const { name, arguments: args } = request.params; if (name in toolHandlers) { return await (toolHandlers as any)[name](args || {}); } throw new Error(`Unknown tool: ${name}`); });

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/jwaresolutions/polygon-mcp-server'

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