Skip to content
Eden Engine

St.Gallen Open Data: Query Records

sgchdatenkanton/query-records

Reads rows from one dataset of Open Data Kanton St.Gallen (daten.sg.ch, Switzerland) by its dataset id, with an optional column list, one filter condition (a text search, or a column compared with a text or number value), a sort on one column, a row limit up to 50 and an offset for paging. Returns the matching row count and the rows with the dataset's own columns. Find dataset ids with the search-datasets tool. Canton of St.Gallen data, most of it under 'Freie Nutzung mit Quellenangabe'; served by Eden Engine; not an official Kanton St.Gallen product.

activeper callv1

Price

$0.0026 per call

You pay the price shown. If a call turns out to cost more than its quote, you pay the actual price, capped at twice the quote. No monthly minimum. Top-ups start at $5.00.

Data source

Open Data Kanton St.Gallen

Source: Open Data Kanton St.Gallen (daten.sg.ch). Most data is released under 'Freie Nutzung mit Quellenangabe' (commercial use allowed, source must be named); credit the source and follow the licence each dataset declares. Served by Eden Engine; not an official Kanton St.Gallen product.

Use it

Your AI assistant does the work: it finds this tool, shows you the price first, runs it, and you are charged when the run finishes. There is nothing to set up for this tool in particular.

Connect once and your AI can find and run this tool, and any other it needs.

For developers: the calls your assistant makes
agent
// 1. search: find the tool
omnial_search({ query: "what you need" })

// 2. inspect: price and input schema
omnial_inspect({ tool: "sgchdatenkanton/query-records" })

// 3. learn: read the usage guide at runtime
omnial_learn({ tool: "sgchdatenkanton/query-records" })

// 4. run: price the exact call first, then run it
omnial_execute({ tool: "sgchdatenkanton/query-records", input: { /* see input_schema */ }, dry_run: true })
omnial_execute({ tool: "sgchdatenkanton/query-records", input: { /* ... */ } })

// 5. settle: the call is charged when it finishes, nothing to do

Not connected yet? Point your MCP client at https://mcp.eden-engine.com/mcp, then copy a config for your client.

Pricing

Every charge this tool can incur.

ChargePrice
Per call
$0.0026
Updated
Oct 27, 2026

Input and output schemas

Input schema
input_schema.json
{
  "type": "object",
  "required": [
    "dataset_id"
  ],
  "properties": {
    "limit": {
      "type": "integer",
      "default": 10,
      "maximum": 50,
      "minimum": 1,
      "description": "Rows to return, 1 to 50. Defaults to 10."
    },
    "where": {
      "type": "string",
      "pattern": "^(search\\(\"[^\"\\\\]{1,100}\"\\)|[A-Za-z0-9_]{1,60} ?(=|!=|<=|>=|<|>) ?(\"[^\"\\\\]{0,100}\"|-?[0-9]+(\\.[0-9]+)?))$",
      "maxLength": 200,
      "minLength": 1,
      "description": "One condition: either search(\"text\") for a text search over the row, or <column> <operator> <value> with =, !=, <, <=, > or >=, for example anzahl_schueler>=1000 or volksschultraeger_name = \"Stadt Gossau\". Leave out for all rows. A column compared with a value of the wrong type is refused by the portal."
    },
    "offset": {
      "type": "integer",
      "maximum": 9950,
      "minimum": 0,
      "description": "Rows to skip, for reading further pages. Leave out for the first page."
    },
    "select": {
      "type": "string",
      "pattern": "^[A-Za-z0-9_]{1,60}(,[A-Za-z0-9_]{1,60}){0,29}$",
      "maxLength": 600,
      "minLength": 1,
      "description": "Comma-separated column names to return, for example jahr,bfsnr,anzahl_schueler. Leave out for every column. An unknown column is refused by the portal."
    },
    "order_by": {
      "type": "string",
      "pattern": "^[A-Za-z0-9_]{1,60}( (asc|desc))?$",
      "maxLength": 70,
      "minLength": 1,
      "description": "Sort by one column, optionally followed by asc or desc, for example anzahl_schueler desc. Leave out for the portal's order."
    },
    "dataset_id": {
      "type": "string",
      "pattern": "^[A-Za-z0-9_-]+$",
      "maxLength": 120,
      "minLength": 1,
      "description": "Dataset identifier from the search-datasets tool, for example `rechnungszahlen-volksschultrager-kanton-stgallen`."
    }
  },
  "additionalProperties": false
}
Output schema
output_schema.json
{
  "type": "object",
  "required": [
    "total_count",
    "results"
  ],
  "properties": {
    "results": {
      "type": "array",
      "items": {
        "type": "object",
        "additionalProperties": true
      },
      "description": "The rows, one object per row with the dataset's own columns; empty when nothing matches."
    },
    "total_count": {
      "type": "integer",
      "description": "Number of rows matching the condition."
    }
  },
  "description": "The portal's records envelope: the number of matching rows and the requested page.",
  "additionalProperties": true
}