subclasses_of

Pack: wikidata-sparql · Endpoint: https://gateway.pipeworx.io/wikidata-sparql/mcp

Return all subclasses of a Wikidata class via transitive P279 (subclass-of) traversal; takes a Wikidata entity id (e.g. Q11424) and returns labelled subclass items up to the specified limit.

Parameters

NameTypeRequiredDescription
entity_idstringyes
langstringno
limitnumberno

Example call

Arguments

{
  "entity_id": "Q146"
}

curl

curl -X POST https://gateway.pipeworx.io/wikidata-sparql/mcp \
  -H 'Content-Type: application/json' \
  -d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"subclasses_of","arguments":{"entity_id":"Q146"}}}'

TypeScript (@pipeworx/sdk)

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

const result = await pipeworx.call('subclasses_of', {
  "entity_id": "Q146"
});

More examples

{
  "entity_id": "Q7889",
  "lang": "fr",
  "limit": 200
}

Response shape

FieldTypeDescription
headobject
resultsobject
Full JSON Schema
{
  "type": "object",
  "properties": {
    "head": {
      "type": "object",
      "properties": {
        "vars": {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      }
    },
    "results": {
      "type": "object",
      "properties": {
        "bindings": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "subclass": {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string"
                  },
                  "value": {
                    "type": "string",
                    "description": "Subclass URI"
                  }
                }
              },
              "subclassLabel": {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string"
                  },
                  "value": {
                    "type": "string",
                    "description": "Subclass label"
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}

Connect

Add this to your MCP client config, or use one-click install buttons:

{
  "mcpServers": {
    "wikidata-sparql": {
      "url": "https://gateway.pipeworx.io/wikidata-sparql/mcp"
    }
  }
}

See Getting Started for client-specific install steps.

Regenerated from source · build July 6, 2026