query_table

Pack: stat-gl · Connect: https://pipeworx.io/mcp (see Connect below for a single-pack URL)

No MCP client? Call it directly: GET https://gateway.pipeworx.io/v1/tools/query_table for the schema, then POST the same URL with its arguments for the data.

POST a PxWeb query to a Statistics Greenland table and return observations as json-stat2. body must be {query:[{code, selection:{filter,values}}], response:{format:‘json-stat2’}}. An empty query ({query:[]}) requests the full table but may be rejected for large tables — narrow selections using codes from table_meta.

Parameters

NameTypeRequiredDescription
pathstringyese.g. “BE/BE01/BEXSAT1.PX”
bodyobjectyes{query: [{code, selection: {filter, values}}], response: {format: “json-stat2”}}
selectionunknownno
responseunknownno

Example call

Arguments

{
  "path": "BE/BE01/BEXSAT1.PX",
  "body": {
    "query": [
      {
        "code": "time",
        "selection": {
          "filter": "item",
          "values": [
            "2024",
            "2025"
          ]
        }
      },
      {
        "code": "type",
        "selection": {
          "filter": "item",
          "values": [
            "Number"
          ]
        }
      },
      {
        "code": "place of birth",
        "selection": {
          "filter": "item",
          "values": [
            "Total"
          ]
        }
      }
    ],
    "response": {
      "format": "json-stat2"
    }
  }
}

curl

curl -X POST https://gateway.pipeworx.io/stat-gl/mcp \
  -H 'Content-Type: application/json' \
  -d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"query_table","arguments":{"path":"BE/BE01/BEXSAT1.PX","body":{"query":[{"code":"time","selection":{"filter":"item","values":["2024","2025"]}},{"code":"type","selection":{"filter":"item","values":["Number"]}},{"code":"place of birth","selection":{"filter":"item","values":["Total"]}}],"response":{"format":"json-stat2"}}}}}'

TypeScript (@pipeworx/sdk)

import { Pipeworx } from '@pipeworx/sdk';
const pipeworx = new Pipeworx();

const result = await pipeworx.call('query_table', {
  "path": "BE/BE01/BEXSAT1.PX",
  "body": {
    "query": [
      {
        "code": "time",
        "selection": {
          "filter": "item",
          "values": [
            "2024",
            "2025"
          ]
        }
      },
      {
        "code": "type",
        "selection": {
          "filter": "item",
          "values": [
            "Number"
          ]
        }
      },
      {
        "code": "place of birth",
        "selection": {
          "filter": "item",
          "values": [
            "Total"
          ]
        }
      }
    ],
    "response": {
      "format": "json-stat2"
    }
  }
});

Connect

Add this to your MCP client config — every tool in the catalog, including this one — or use one-click install buttons:

{
  "mcpServers": {
    "pipeworx": {
      "url": "https://pipeworx.io/mcp"
    }
  }
}
Connect to just the stat-gl pack
{
  "mcpServers": {
    "stat-gl": {
      "url": "https://gateway.pipeworx.io/stat-gl/mcp"
    }
  }
}

See Getting Started for client-specific install steps.

Regenerated from source · build October 16, 2026