Wikidata · Capability

Wikidata REST API & MediaWiki API — Statements

Wikidata REST API & MediaWiki API — Statements. 4 operations. Lead operation: Wikidata Get Statements for an Item. Self-contained Naftiko capability covering one Wikidata business surface.

Run with Naftiko WikidataStatements

What You Can Do

GET
Getitemstatements — Wikidata Get Statements for an Item
/v1/entities/items/{item-id}/statements
POST
Additemstatement — Wikidata Add a Statement to an Item
/v1/entities/items/{item-id}/statements
GET
Getstatement — Wikidata Get a Single Statement
/v1/statements/{statement-id}
DELETE
Deletestatement — Wikidata Delete a Statement
/v1/statements/{statement-id}

MCP Tools

wikidata-get-statements-item

Wikidata Get Statements for an Item

read-only idempotent
wikidata-add-statement-item

Wikidata Add a Statement to an Item

wikidata-get-single-statement

Wikidata Get a Single Statement

read-only idempotent
wikidata-delete-statement

Wikidata Delete a Statement

idempotent

Capability Spec

mediawiki-statements.yaml Raw ↑
naftiko: 1.0.0-alpha2
info:
  label: Wikidata REST API & MediaWiki API — Statements
  description: 'Wikidata REST API & MediaWiki API — Statements. 4 operations. Lead operation: Wikidata Get Statements for
    an Item. Self-contained Naftiko capability covering one Wikidata business surface.'
  tags:
  - Wikidata
  - Statements
  created: '2026-05-19'
  modified: '2026-05-19'
binds:
- namespace: env
  keys:
    WIKIDATA_API_KEY: WIKIDATA_API_KEY
capability:
  consumes:
  - type: http
    namespace: mediawiki-statements
    baseUri: https://www.wikidata.org/w/rest.php/wikibase/v0
    description: Wikidata REST API & MediaWiki API — Statements business capability. Self-contained, no shared references.
    resources:
    - name: entities-items-item_id-statements
      path: /entities/items/{item_id}/statements
      operations:
      - name: getitemstatements
        method: GET
        description: Wikidata Get Statements for an Item
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: property
          in: query
          type: string
          description: Filter statements by property ID
      - name: additemstatement
        method: POST
        description: Wikidata Add a Statement to an Item
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: body
          in: body
          type: object
          description: Request body (JSON).
          required: true
    - name: statements-statement_id
      path: /statements/{statement_id}
      operations:
      - name: getstatement
        method: GET
        description: Wikidata Get a Single Statement
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: statement_id
          in: path
          type: string
          description: Statement ID (Q{itemId}${guid})
          required: true
      - name: deletestatement
        method: DELETE
        description: Wikidata Delete a Statement
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: statement_id
          in: path
          type: string
          required: true
        - name: body
          in: body
          type: object
          description: Request body (JSON).
          required: false
    authentication:
      type: bearer
      token: '{{env.WIKIDATA_API_KEY}}'
  exposes:
  - type: rest
    namespace: mediawiki-statements-rest
    port: 8080
    description: REST adapter for Wikidata REST API & MediaWiki API — Statements. One Spectral-compliant resource per consumed
      operation, prefixed with /v1.
    resources:
    - path: /v1/entities/items/{item-id}/statements
      name: entities-items-item-id-statements
      description: REST surface for entities-items-item_id-statements.
      operations:
      - method: GET
        name: getitemstatements
        description: Wikidata Get Statements for an Item
        call: mediawiki-statements.getitemstatements
        with:
          property: rest.property
        outputParameters:
        - type: object
          mapping: $.
      - method: POST
        name: additemstatement
        description: Wikidata Add a Statement to an Item
        call: mediawiki-statements.additemstatement
        with:
          body: rest.body
        outputParameters:
        - type: object
          mapping: $.
    - path: /v1/statements/{statement-id}
      name: statements-statement-id
      description: REST surface for statements-statement_id.
      operations:
      - method: GET
        name: getstatement
        description: Wikidata Get a Single Statement
        call: mediawiki-statements.getstatement
        with:
          statement_id: rest.statement_id
        outputParameters:
        - type: object
          mapping: $.
      - method: DELETE
        name: deletestatement
        description: Wikidata Delete a Statement
        call: mediawiki-statements.deletestatement
        with:
          statement_id: rest.statement_id
          body: rest.body
        outputParameters:
        - type: object
          mapping: $.
  - type: mcp
    namespace: mediawiki-statements-mcp
    port: 9090
    transport: http
    description: MCP adapter for Wikidata REST API & MediaWiki API — Statements. One tool per consumed operation, routed inline
      through this capability's consumes block.
    tools:
    - name: wikidata-get-statements-item
      description: Wikidata Get Statements for an Item
      hints:
        readOnly: true
        destructive: false
        idempotent: true
      call: mediawiki-statements.getitemstatements
      with:
        property: tools.property
      outputParameters:
      - type: object
        mapping: $.
    - name: wikidata-add-statement-item
      description: Wikidata Add a Statement to an Item
      hints:
        readOnly: false
        destructive: false
        idempotent: false
      call: mediawiki-statements.additemstatement
      with:
        body: tools.body
      outputParameters:
      - type: object
        mapping: $.
    - name: wikidata-get-single-statement
      description: Wikidata Get a Single Statement
      hints:
        readOnly: true
        destructive: false
        idempotent: true
      call: mediawiki-statements.getstatement
      with:
        statement_id: tools.statement_id
      outputParameters:
      - type: object
        mapping: $.
    - name: wikidata-delete-statement
      description: Wikidata Delete a Statement
      hints:
        readOnly: false
        destructive: true
        idempotent: true
      call: mediawiki-statements.deletestatement
      with:
        statement_id: tools.statement_id
        body: tools.body
      outputParameters:
      - type: object
        mapping: $.