gva_count
Count geographic features in the Valencian Community using SQL WHERE clauses to filter land activity data from GVA GIS.
Instructions
Count features matching a WHERE clause
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| where | No | SQL WHERE clause (e.g., '1=1' for all) | 1=1 |
Implementation Reference
- typescript/src/index.ts:239-260 (handler)Handler implementation for the 'gva_count' tool in TypeScript. Queries the ArcGIS FeatureServer with returnCountOnly=true to get the count of features matching the WHERE clause.case "gva_count": { // Count features const countArgs = args as CountArguments; const url = `${BASE_URL}/${LAYER_ID}/query`; const params: RequestParams = { where: countArgs.where || "1=1", returnCountOnly: "true", f: "json", }; const data = await makeRequest(url, params); const count = data.count || 0; return { content: [ { type: "text", text: `Total features matching query: ${count}`, }, ], }; }
- mcp4gva/server.py:181-197 (handler)Handler implementation for the 'gva_count' tool in Python. Queries the ArcGIS FeatureServer with returnCountOnly=true to get the count of features matching the WHERE clause.elif name == "gva_count": # Count features url = f"{BASE_URL}/{LAYER_ID}/query" params = { 'where': arguments.get('where', '1=1'), 'returnCountOnly': 'true', 'f': 'json' } data = make_request(url, params) count = data.get('count', 0) return [TextContent( type="text", text=f"Total features matching query: {count}" )]
- typescript/src/index.ts:141-151 (schema)Input schema for the 'gva_count' tool in TypeScript version, defining the optional 'where' parameter.inputSchema: { type: "object", properties: { where: { type: "string", description: 'SQL WHERE clause (e.g., "1=1" for all)', default: "1=1", }, }, required: [], },
- mcp4gva/server.py:97-106 (schema)Input schema for the 'gva_count' tool in Python version, defining the optional 'where' parameter."type": "object", "properties": { "where": { "type": "string", "description": "SQL WHERE clause (e.g., '1=1' for all)", "default": "1=1" } }, "required": [] }