# Obtener recurso

URL canónica: https://sosoapi.ai/es/docs/mcp/get-asset

`sosoapi_get_asset`

Consulta un recurso por id: metadatos y una URL de vista previa de corta duración.

## Perfiles y transportes

Perfiles: core, full

Transportes: stdio, http

Elige core o full para controlar qué herramientas ve tu cliente; no cambia sus permisos. La carga de archivos locales requiere stdio y no está disponible por HTTP. Establece SOSOAPI_OUTPUT_SCHEMAS=1 para incluir esquemas de salida en la detección. Las herramientas devuelven resultados estructurados con o sin esa opción.

## Permisos y efectos secundarios

Las anotaciones ayudan a los clientes a describir una herramienta. Cada llamada sigue comprobando la autenticación, el rol, el acceso al recurso y los permisos de capacidades del usuario.

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

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

## Campos de entrada

```json
{
  "type": "object",
  "properties": {
    "workspace_id": {
      "type": "string",
      "format": "uuid"
    },
    "id": {
      "anyOf": [
        {
          "type": "integer",
          "minimum": -9007199254740991,
          "maximum": 9007199254740991
        },
        {
          "type": "string"
        }
      ]
    },
    "include_version": {
      "description": "Optional. true adds the resource version to the answer.",
      "type": "boolean"
    }
  },
  "required": [
    "id"
  ],
  "additionalProperties": false
}
```

## Salida estructurada

Este esquema describe structuredContent en un resultado exitoso de herramienta. La respuesta MCP también incluye content y puede establecer isError si falla una llamada. Para publicación, consulta el resultado final de la publicación en vez de considerar una solicitud aceptada o una respuesta de texto como confirmación. La operación API enlazada explica los permisos y las reglas de reintento.

```json
{
  "type": "object",
  "properties": {
    "asset": {
      "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
    }
  },
  "required": [
    "asset"
  ],
  "$schema": "http://json-schema.org/draft-07/schema#",
  "additionalProperties": false
}
```

## Ejemplo de llamada a herramienta

Estos ejemplos usan valores ficticios comprobados con los esquemas. Sustituye los IDs por otros autorizados, los archivos multimedia por recursos listos y las fechas por tu hora de publicación confirmada. Comprueba la elegibilidad de la cuenta antes de enviar una escritura. Esta página no envía solicitudes API.

```json
{
  "name": "sosoapi_get_asset",
  "arguments": {
    "id": 0
  }
}
```

structuredContent

```json
{
  "asset": {
    "id": 0,
    "workspace_id": "11111111-1111-4111-8111-111111111111",
    "user_id": "11111111-1111-4111-8111-111111111111",
    "asset_type": "text",
    "asset_url": null,
    "title": null,
    "description": null,
    "tags": null,
    "metadata": null,
    "created_at": "example"
  }
}
```

## Operaciones API subyacentes

- [/assets-api/get](https://sosoapi.ai/es/docs/api/assets-api-get)
