> ## Documentation Index
> Fetch the complete documentation index at: https://docs.sia.vision/llms.txt
> Use this file to discover all available pages before exploring further.

# Generate the next Location reference stage

> location_reference_generate: permissions and generated input/output contracts.

`location_reference_generate` · Gateway release **0.8.3**

Continue the existing Location workflow using account billing: one establishing image first, then inspect it via location\_reference\_get, then the missing layout/lighting views sequentially. Read current versions first. Sources condition only establishing generation; ordered authorities and every exact source are retained. Maximum four sources, never truncated. Derivatives use only the inspected establishing anchor. Default candidates remain unapproved; no automatic paid retries. Reuse the original operationId and inspect/recover its job after uncertain responses. Do not replace an existing establishing view unless requested.

Required scopes: `account:read`, `studio:generate`. Changes saved state or requests work; review the operation’s effects.

Availability depends on runtime configuration and the permissions granted to this connection. Use live MCP discovery as the authority.

## Input

```json theme={null}
{
  "type": "object",
  "additionalProperties": false,
  "properties": {
    "storyworldId": {
      "type": "string",
      "pattern": "^[a-fA-F0-9]{24}$",
      "description": "ID of an accessible saved Storyworld returned by discovery. Keep this destination fixed for the operation."
    },
    "locationId": {
      "type": "string",
      "pattern": "^[a-fA-F0-9]{24}$",
      "description": "ID of the saved Location being inspected or continued."
    },
    "operationId": {
      "type": "string",
      "pattern": "^[a-zA-Z0-9-]{16,64}$",
      "description": "Persist a client-generated UUID before this mutation. Repeat identical inputs and this same ID after interruption; a new ID is a new request."
    },
    "expectedVersion": {
      "type": "integer",
      "minimum": 1,
      "description": "Copy the current version from the latest workflow read. Refresh after a conflict; never increment or guess it."
    },
    "expectedBibleUpdatedAt": {
      "type": [
        "string",
        "null"
      ]
    },
    "referenceSetId": {
      "type": "string",
      "pattern": "^[a-zA-Z0-9_-]{1,100}$"
    },
    "stage": {
      "type": "string",
      "enum": [
        "establishing",
        "derivatives"
      ]
    },
    "anchorFingerprint": {
      "type": "string",
      "pattern": "^[a-f0-9]{64}$",
      "description": "Use the inspected establishing-image fingerprint before generating dependent Location views."
    },
    "anchorReviewed": {
      "type": "boolean",
      "description": "True only after the agent has inspected the actual establishing image. Delivery alone is not review."
    },
    "textOnly": {
      "type": "boolean"
    },
    "expectedDocumentVersion": {
      "type": [
        "integer",
        "null"
      ],
      "minimum": 1,
      "description": "Copy the current document version from the latest workflow read before changing the saved reference."
    },
    "replaceEstablishing": {
      "type": "boolean"
    },
    "sources": {
      "type": "array",
      "maxItems": 4,
      "items": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "assetId": {
            "type": "string",
            "pattern": "^[a-fA-F0-9]{24}$",
            "description": "ID of an already saved and linked Media record returned by this workflow."
          },
          "version": {
            "type": "integer",
            "minimum": 1
          },
          "sha256": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          },
          "generation": {
            "type": "string",
            "pattern": "^[0-9]+$",
            "description": "Immutable storage generation from the first media range; reuse it for every subsequent range."
          },
          "authority": {
            "type": "string",
            "enum": [
              "architecture",
              "materials",
              "lighting",
              "detail"
            ]
          },
          "notes": {
            "type": "string",
            "minLength": 1,
            "maxLength": 500
          }
        },
        "required": [
          "assetId",
          "version",
          "sha256",
          "generation",
          "authority"
        ]
      }
    }
  },
  "required": [
    "storyworldId",
    "locationId",
    "operationId",
    "expectedVersion",
    "expectedDocumentVersion",
    "expectedBibleUpdatedAt",
    "referenceSetId",
    "stage"
  ]
}
```

## Declared output

This is the declared success schema. Error results and binary media blocks are separate MCP protocol results.

```json theme={null}
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "schemaVersion": {
      "type": "string",
      "const": "1"
    },
    "jobId": {
      "type": "string",
      "pattern": "^[a-f0-9]{64}$"
    },
    "status": {
      "type": "string"
    }
  },
  "required": [
    "schemaVersion",
    "jobId",
    "status"
  ],
  "additionalProperties": {}
}
```

[All tools](https://docs.sia.vision/mcp-reference.md) · [Permissions](https://docs.sia.vision/authentication.md) · [Media and recovery](https://docs.sia.vision/media-and-recovery.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.