Skip to main content
Glama
GeocodeTool.ts714 B
import { MCPTool } from "mcp-framework"; import { z } from "zod"; import { geocode, GEOCODE_SOURCE } from "../gpf/geocode.js"; import logger from "../logger.js"; interface GeocodeInput { text: string; } class GeocodeTool extends MCPTool<GeocodeInput> { name = "geocode"; description = `Renvoie les coordonnées (lon,lat) d'un lieu en complétant les informations (source : ${GEOCODE_SOURCE}).`; schema = { text: { type: z.string(), description: "Le texte devant être completé et géocodé", }, }; async execute(input: GeocodeInput) { logger.info(`geocode(${input.text})...`); return geocode(input.text); } } export default GeocodeTool;

Implementation Reference

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/ignfab/geocontext'

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