Skip to main content
Glama

get_well_permits

Search for Colorado well permits by name or receipt number to access water resource data from the DWR REST API.

Instructions

Search for well permits

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
wellNameNoName of the well
receiptNoReceipt number
pageSizeNoNumber of results to return

Implementation Reference

  • The switch case handler for the 'get_well_permits' tool, which extracts arguments and calls the shared handleApiCall method with the specific endpoint 'wellpermits/wellpermit'.
    case "get_well_permits": { const args = request.params.arguments as any; return await this.handleApiCall("wellpermits/wellpermit", args); }
  • Zod schema defining the input parameters for the get_well_permits tool: wellName, receipt, pageSize.
    z.object({ wellName: z.string().optional().describe("Name of the well"), receipt: z.string().optional().describe("Receipt number"), pageSize: z.number().optional().describe("Number of results to return"), })
  • src/index.ts:95-105 (registration)
    Registration of the 'get_well_permits' tool in the ListTools response, including name, description, and inputSchema.
    { name: "get_well_permits", description: "Search for well permits", inputSchema: zodToJsonSchema( z.object({ wellName: z.string().optional().describe("Name of the well"), receipt: z.string().optional().describe("Receipt number"), pageSize: z.number().optional().describe("Number of results to return"), }) ), },
  • The handleApiCall method that performs the actual API request to the DWR REST API, formats parameters, adds apiKey if available, and returns the JSON response. This is the core logic executed by the get_well_permits handler.
    public async handleApiCall(endpoint: string, params: any) { const url = `${BASE_URL}/${endpoint}`; const headers: Record<string, string> = {}; if (this.apiKey) { headers["Authorization"] = this.apiKey; // Or however DWR expects it, docs say 'Token: ...' or query param } // DWR docs say: "Token: B9xxxxx-xxxx-4D47-y" in header OR apiKey query param // I'll use query param if apiKey is present to be safe/easy, or header if I can confirm. // Docs: "Request Header: ... Token: ..." // Let's stick to query params for simplicity if header format is custom. // Actually, let's use the params object. const finalParams = formatParams(params); if (this.apiKey) { finalParams["apiKey"] = this.apiKey; } console.error(`Fetching ${url} with params ${JSON.stringify(finalParams)}`); const response = await axios.get(url, { params: finalParams, headers, }); return { content: [ { type: "text", text: JSON.stringify(response.data, null, 2), }, ], }; }

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/EdgeworthHitbox/dwr-mcp-server'

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