# Assets abfragen

Kanonische URL: https://sosoapi.ai/de/docs/mcp/query-assets

`sosoapi_query_assets`

Finde Workspace-Assets nach asset_type, source oder tag; liefert eine Seite (limit bis 100, plus offset) und Gesamtzahl. Übergib workspace_id ausdrücklich.

## Profile und Transporte

Profile: core, full

Transporte: stdio, http

Wähle core oder full für die sichtbaren Tools deines Clients; dies ändert keine Berechtigungen. Lokaler Dateiupload benötigt stdio und ist über HTTP nicht verfügbar. Setze SOSOAPI_OUTPUT_SCHEMAS=1 für Ausgabeschemas in der Erkennung. Tools liefern unabhängig davon strukturierte Ergebnisse.

## Berechtigungen und Nebeneffekte

Annotationen helfen Clients, Tools zu beschreiben. Jeder Aufruf prüft weiterhin Authentifizierung, Rolle, Ressourcenzugriff und erteilte Funktionen des Nutzers.

```json
{
  "readOnlyHint": true,
  "destructiveHint": false,
  "idempotentHint": true,
  "openWorldHint": false
}
```

`/assets-api/list` — agent:operate; synchronous_http_response

## Eingabefelder

```json
{
  "type": "object",
  "properties": {
    "workspace_id": {
      "type": "string",
      "format": "uuid"
    },
    "asset_type": {
      "anyOf": [
        {
          "type": "string",
          "enum": [
            "text",
            "image",
            "video",
            "audio"
          ]
        },
        {
          "type": "array",
          "items": {
            "type": "string",
            "enum": [
              "text",
              "image",
              "video",
              "audio"
            ]
          }
        }
      ]
    },
    "source": {
      "type": "string",
      "maxLength": 64
    },
    "tag": {
      "type": "string",
      "maxLength": 64
    },
    "limit": {
      "type": "integer",
      "minimum": 1,
      "maximum": 100
    },
    "offset": {
      "description": "Rows to skip. Served up to 100000; beyond it 400 OFFSET_TOO_LARGE. Prefer filters to paging deep.",
      "type": "integer",
      "minimum": 0,
      "maximum": 9007199254740991
    },
    "include_version": {
      "description": "Optional. true adds the resource version to the answer.",
      "type": "boolean"
    }
  },
  "additionalProperties": false
}
```

## Strukturierte Ausgabe

Dieses Schema beschreibt structuredContent in einem erfolgreichen Tool-Ergebnis. Die MCP-Antwort enthält auch content und kann bei fehlgeschlagenem Aufruf isError setzen. Lies bei Veröffentlichungen das endgültige Beitragsergebnis, statt eine angenommene Anfrage oder Textantwort als Bestätigung zu werten. Die verknüpfte API-Operation erklärt Berechtigungen und Wiederholungsregeln.

```json
{
  "type": "object",
  "properties": {
    "assets": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991
              },
              {
                "type": "string"
              }
            ]
          },
          "workspace_id": {
            "type": "string",
            "format": "uuid"
          },
          "user_id": {
            "type": "string",
            "format": "uuid"
          },
          "asset_type": {
            "type": "string",
            "enum": [
              "text",
              "image",
              "video",
              "audio"
            ]
          },
          "asset_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "preview_url": {
            "description": "Workspace-authorized temporary read URL. Refresh through Asset read/list after preview_expires_at; keep asset_url as persisted media identity.",
            "anyOf": [
              {
                "type": "string",
                "format": "uri"
              },
              {
                "type": "null"
              }
            ]
          },
          "preview_expires_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
              },
              {
                "type": "null"
              }
            ]
          },
          "title": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "tags": {
            "anyOf": [
              {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              {
                "type": "null"
              }
            ]
          },
          "metadata": {
            "anyOf": [
              {
                "type": "object",
                "propertyNames": {
                  "type": "string"
                },
                "additionalProperties": {}
              },
              {
                "type": "null"
              }
            ]
          },
          "source": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "source_metadata": {
            "anyOf": [
              {
                "type": "object",
                "propertyNames": {
                  "type": "string"
                },
                "additionalProperties": {}
              },
              {
                "type": "null"
              }
            ]
          },
          "created_at": {
            "type": "string"
          },
          "version": {
            "type": "integer",
            "exclusiveMinimum": 0,
            "maximum": 9007199254740991
          }
        },
        "required": [
          "id",
          "workspace_id",
          "user_id",
          "asset_type",
          "asset_url",
          "title",
          "description",
          "tags",
          "metadata",
          "created_at"
        ],
        "additionalProperties": false
      }
    },
    "total": {
      "type": "integer",
      "minimum": 0,
      "maximum": 9007199254740991
    }
  },
  "required": [
    "assets",
    "total"
  ],
  "$schema": "http://json-schema.org/draft-07/schema#",
  "additionalProperties": false
}
```

## Beispiel eines Tool-Aufrufs

Diese Beispiele nutzen anhand der Schemas geprüfte fiktive Werte. Ersetze IDs durch autorisierte IDs, Medien durch bereite Assets und Daten durch bestätigte Veröffentlichungszeiten. Prüfe Kontoeignung vor Schreibvorgängen. Diese Seite sendet keine API-Anfragen.

```json
{
  "name": "sosoapi_query_assets",
  "arguments": {}
}
```

structuredContent

```json
{
  "assets": [],
  "total": 0
}
```

## Zugrunde liegende API-Operationen

- [/assets-api/list](https://sosoapi.ai/de/docs/api/assets-api-list)
