ch_law_search

Pack: switzerland-law · 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/ch_law_search for the schema, then POST the same URL with its arguments for the data.

Search Swiss federal legislation (Fedlex, Federal Chancellery) by title word, abbreviation or SR number, in German, French, Italian or English: e.g. query “Datenschutz” lang “de”, query “protection des donnees” lang “fr”, abbreviation “DSG”, or sr_number “235.1” (the Classified Compilation number). By default only acts in force today are returned (in_force_only=false adds repealed and not-yet-in-force acts). Returns id (the SR number, usable in ch_law_get), title, short title, SR number, AS (Official Compilation) reference, entry-into-force date, status and link; 25 per page, use page to continue. Federal law only, no cantonal law and no EU law.

Parameters

NameTypeRequiredDescription
querystringnoWord(s) from the title in the chosen language, all must match, e.g. “Datenschutz” or “protection des donnees”
abbreviationstringnoOfficial short title, e.g. “DSG”, “ZGB”, “StGB”, “LPD”
sr_numberstringnoClassified Compilation (SR) number, e.g. “235.1” (use instead of query)
langstringnoLanguage of the title search and of the titles returned (default de)
in_force_onlybooleannoOnly acts in force today (default true)
pagenumbernoPage number, 1-based (default 1)

Example call

Arguments

{
  "query": "Datenschutz",
  "lang": "de"
}

curl

curl -X POST https://gateway.pipeworx.io/switzerland-law/mcp \
  -H 'Content-Type: application/json' \
  -d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"ch_law_search","arguments":{"query":"Datenschutz","lang":"de"}}}'

TypeScript (@pipeworx/sdk)

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

const result = await pipeworx.call('ch_law_search', {
  "query": "Datenschutz",
  "lang": "de"
});

Response shape

FieldTypeDescription
querystring | null
abbreviationstring | null
sr_numberstring | null
langstring | null
in_force_onlyboolean | null
pagenumber | null
countnumber | null
resultsarray | null
next_pagenumber | null
sourcestring | null
data_as_ofstring | null
empty_reasonstring | null
Full JSON Schema
{
  "type": "object",
  "properties": {
    "query": {
      "type": [
        "string",
        "null"
      ]
    },
    "abbreviation": {
      "type": [
        "string",
        "null"
      ]
    },
    "sr_number": {
      "type": [
        "string",
        "null"
      ]
    },
    "lang": {
      "type": [
        "string",
        "null"
      ]
    },
    "in_force_only": {
      "type": [
        "boolean",
        "null"
      ]
    },
    "page": {
      "type": [
        "number",
        "null"
      ]
    },
    "count": {
      "type": [
        "number",
        "null"
      ]
    },
    "results": {
      "type": [
        "array",
        "null"
      ],
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": [
              "string",
              "null"
            ]
          },
          "eli": {
            "type": [
              "string",
              "null"
            ]
          },
          "title": {
            "type": [
              "string",
              "null"
            ]
          },
          "short_title": {
            "type": [
              "string",
              "null"
            ]
          },
          "sr_number": {
            "type": [
              "string",
              "null"
            ]
          },
          "as_reference": {
            "type": [
              "string",
              "null"
            ]
          },
          "adopted": {
            "type": [
              "string",
              "null"
            ]
          },
          "in_force_from": {
            "type": [
              "string",
              "null"
            ]
          },
          "status": {
            "type": [
              "string",
              "null"
            ]
          },
          "url": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "additionalProperties": true
      }
    },
    "next_page": {
      "type": [
        "number",
        "null"
      ]
    },
    "source": {
      "type": [
        "string",
        "null"
      ]
    },
    "data_as_of": {
      "type": [
        "string",
        "null"
      ]
    },
    "empty_reason": {
      "type": [
        "string",
        "null"
      ]
    }
  },
  "additionalProperties": true
}

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 switzerland-law pack
{
  "mcpServers": {
    "switzerland-law": {
      "url": "https://gateway.pipeworx.io/switzerland-law/mcp"
    }
  }
}

See Getting Started for client-specific install steps.

Regenerated from source · build November 15, 2026