forex_weekly
Retrieve weekly forex time series data for specific currency pairs. Specify input and output currencies, and choose response format as JSON or CSV.
Instructions
Fetches weekly time series data for a Forex pair.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| datatype | No | Data format for the response. | json |
| from_symbol | Yes | The currency symbol to convert from (e.g., "EUR"). | |
| to_symbol | Yes | The currency symbol to convert to (e.g., "USD"). |
Input Schema (JSON Schema)
{
"additionalProperties": false,
"description": "Parameters for fetching weekly/monthly Forex time series data.",
"properties": {
"datatype": {
"default": "json",
"description": "Data format for the response.",
"enum": [
"json",
"csv"
],
"type": "string"
},
"from_symbol": {
"description": "The currency symbol to convert from (e.g., \"EUR\").",
"type": "string"
},
"to_symbol": {
"description": "The currency symbol to convert to (e.g., \"USD\").",
"type": "string"
}
},
"required": [
"from_symbol",
"to_symbol"
],
"type": "object"
}
Implementation Reference
- src/index.ts:749-760 (registration)Registers the 'forex_weekly' MCP tool with name, description, input schema reference, and inline execute handler that calls Alpha Vantage's forex.weekly API via the shared executeAvantageTool helper.server.addTool({ name: "forex_weekly", description: "Fetches weekly time series data for a Forex pair.", parameters: schemas.ForexWeeklyMonthlyParamsSchema, execute: ( args, context // Let type be inferred ) => executeAvantageTool("forex_weekly", args, context, (av, params) => av.forex.weekly(params) ), });
- src/schemas.ts:165-169 (schema)Zod validation schema for input parameters to the forex_weekly tool (shared with forex_monthly): from_symbol, to_symbol, and optional datatype.export const ForexWeeklyMonthlyParamsSchema = z.object({ from_symbol: z.string().describe('The currency symbol to convert from (e.g., "EUR").'), to_symbol: z.string().describe('The currency symbol to convert to (e.g., "USD").'), datatype: DatatypeSchema.default('json').optional(), }).describe('Parameters for fetching weekly/monthly Forex time series data.')
- src/index.ts:753-760 (handler)Inline handler function for forex_weekly tool execution, which invokes the Alpha Vantage forex.weekly endpoint using the executeAvantageTool wrapper.execute: ( args, context // Let type be inferred ) => executeAvantageTool("forex_weekly", args, context, (av, params) => av.forex.weekly(params) ), });