# place.hud.previewView

> Draw a view given inline, as list_records, get_record or query draw one: checked first, its problems answered and nothing read when it has any; else, given no answer, the call made afresh, its result answered; given the answer that call read before (its structuredContent), drawn again over it, nothing read again but what the tool reads to draw (handles, lexicons, linked posts). An inline view is untrusted, as anywhere. No auth required: signed in (the workspace's web session, its cookie with X-HUD: 1 and the server's own Origin, or a HUD access token as Bearer), the call is made as the account; else as no one.

- Kind: procedure
- Authority: hud.place
- Lexicon: 1
- Published by [lexicons.hud.place](https://lexicon.garden/identity/did:plc:3tzbz4pml36u4mkresb6pdhv), the NSID's authority

## Links

- [Documentation](https://lexicon.garden/lexicon/did:plc:3tzbz4pml36u4mkresb6pdhv/place.hud.previewView)
- [Schema JSON](https://lexicon.garden/lexicon/did:plc:3tzbz4pml36u4mkresb6pdhv/place.hud.previewView/schema.json)
- [Analytics](https://lexicon.garden/lexicon/did:plc:3tzbz4pml36u4mkresb6pdhv/place.hud.previewView/analytics)

## Procedure (`place.hud.previewView`)

Type: procedure · POST

### Input (application/json)

- `answer` (unknown): What the same call answered before as its structuredContent, read with a view whose joins and query are this one's: drawn again with this view, not read again.
- `arguments` (unknown, required): The tool's arguments, an object, the view in it as view.
- `tool` (string, required): The tool that draws the view.
  - Constraints: maxLength: 64, knownValues: list_records | get_record | query

### Output (application/json)

- `problems` (array): Why the view is not valid, every problem, in the order found: then nothing is read or drawn.
  - `items` (ref)
    - Reference: `#problem`
- `result` (unknown): The call's MCP CallToolResult, read afresh: content, structuredContent, isError and _meta. A tool's error is its result's, isError true.
- `ui` (ref): The view drawn over the answer given, as the tool's _meta.ui.
  - Reference: `place.hud.ui`

### Errors

- `InvalidRequest`: A tool that draws no view, arguments that are not an object or name no view, an answer that is not of that call, or input not what the method takes.

## #problem (`place.hud.previewView#problem`)

Type: object

One problem of a view.

### Properties

- `at` (string, required): Where in the view, as a path of keys and [indexes], as list.layout.children[0].props.gap; view for the whole.
  - Constraints: maxLength: 1024
- `message` (string, required): What is wrong there.
  - Constraints: maxLength: 2048

## Schema

```json
{
  "$type": "com.atproto.lexicon.schema",
  "defs": {
    "main": {
      "description": "Draw a view given inline, as list_records, get_record or query draw one: checked first, its problems answered and nothing read when it has any; else, given no answer, the call made afresh, its result answered; given the answer that call read before (its structuredContent), drawn again over it, nothing read again but what the tool reads to draw (handles, lexicons, linked posts). An inline view is untrusted, as anywhere. No auth required: signed in (the workspace's web session, its cookie with X-HUD: 1 and the server's own Origin, or a HUD access token as Bearer), the call is made as the account; else as no one.",
      "errors": [
        {
          "description": "A tool that draws no view, arguments that are not an object or name no view, an answer that is not of that call, or input not what the method takes.",
          "name": "InvalidRequest"
        }
      ],
      "input": {
        "encoding": "application/json",
        "schema": {
          "properties": {
            "answer": {
              "description": "What the same call answered before as its structuredContent, read with a view whose joins and query are this one's: drawn again with this view, not read again.",
              "type": "unknown"
            },
            "arguments": {
              "description": "The tool's arguments, an object, the view in it as view.",
              "type": "unknown"
            },
            "tool": {
              "description": "The tool that draws the view.",
              "knownValues": [
                "list_records",
                "get_record",
                "query"
              ],
              "maxLength": 64,
              "type": "string"
            }
          },
          "required": [
            "tool",
            "arguments"
          ],
          "type": "object"
        }
      },
      "output": {
        "encoding": "application/json",
        "schema": {
          "properties": {
            "problems": {
              "description": "Why the view is not valid, every problem, in the order found: then nothing is read or drawn.",
              "items": {
                "ref": "#problem",
                "type": "ref"
              },
              "type": "array"
            },
            "result": {
              "description": "The call's MCP CallToolResult, read afresh: content, structuredContent, isError and _meta. A tool's error is its result's, isError true.",
              "type": "unknown"
            },
            "ui": {
              "description": "The view drawn over the answer given, as the tool's _meta.ui.",
              "ref": "place.hud.ui",
              "type": "ref"
            }
          },
          "type": "object"
        }
      },
      "type": "procedure"
    },
    "problem": {
      "description": "One problem of a view.",
      "properties": {
        "at": {
          "description": "Where in the view, as a path of keys and [indexes], as list.layout.children[0].props.gap; view for the whole.",
          "maxLength": 1024,
          "type": "string"
        },
        "message": {
          "description": "What is wrong there.",
          "maxLength": 2048,
          "type": "string"
        }
      },
      "required": [
        "at",
        "message"
      ],
      "type": "object"
    }
  },
  "description": "Draw a view being written, for the playground.",
  "id": "place.hud.previewView",
  "lexicon": 1
}
```
