query_table
Pack: makstat-mk · Endpoint: https://gateway.pipeworx.io/makstat-mk/mcp
POST a PxWeb query to a MakStat (North Macedonia statistics) table and return observations as json-stat2. body must be {query:[{code, selection:{filter,values}}], response:{format:‘json-stat2’}}. PxWeb enforces a cell-count limit — narrow each dimension’s values using codes from table_meta to avoid rejection.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
path | string | yes | e.g. “Naselenie/VencaniRazvedeni/280_VitStat_Brak_voz_ml.px” |
body | object | yes | {query: [{code, selection: {filter, values}}], response: {format: “json-stat2”}} |
selection | unknown | no | |
response | unknown | no |
Example call
Arguments
{
"path": "Naselenie/VencaniRazvedeni/280_VitStat_Brak_voz_ml.px",
"body": {
"query": [
{
"code": "Voz",
"selection": {
"filter": "item",
"values": [
"1",
"2"
]
}
},
{
"code": "God",
"selection": {
"filter": "item",
"values": [
"2020",
"2021"
]
}
}
],
"response": {
"format": "json-stat2"
}
}
}
curl
curl -X POST https://gateway.pipeworx.io/makstat-mk/mcp \
-H 'Content-Type: application/json' \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"query_table","arguments":{"path":"Naselenie/VencaniRazvedeni/280_VitStat_Brak_voz_ml.px","body":{"query":[{"code":"Voz","selection":{"filter":"item","values":["1","2"]}},{"code":"God","selection":{"filter":"item","values":["2020","2021"]}}],"response":{"format":"json-stat2"}}}}}'
TypeScript (@pipeworx/sdk)
import { Pipeworx } from '@pipeworx/sdk';
const pipeworx = new Pipeworx();
const result = await pipeworx.call('query_table', {
"path": "Naselenie/VencaniRazvedeni/280_VitStat_Brak_voz_ml.px",
"body": {
"query": [
{
"code": "Voz",
"selection": {
"filter": "item",
"values": [
"1",
"2"
]
}
},
{
"code": "God",
"selection": {
"filter": "item",
"values": [
"2020",
"2021"
]
}
}
],
"response": {
"format": "json-stat2"
}
}
});
Connect
Add this to your MCP client config, or use one-click install buttons:
{
"mcpServers": {
"makstat-mk": {
"url": "https://gateway.pipeworx.io/makstat-mk/mcp"
}
}
}
See Getting Started for client-specific install steps.