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

# Tools reference

> What each Spacebase MCP tool returns, how results are paged, and how CSV exports work.

The Spacebase connector exposes ten read-only tools. You never call them yourself: the assistant chooses which tools to use from your question, calls them, and writes the answer. This page explains what each tool can see, which filters it accepts, and how large results are handled, so you can understand an answer or ask a sharper question.

## Tools at a glance

| Tool | Answers questions about | Paged | CSV download |
| - | - | - | - |
| `list_leases` | Which leases match a search or filter | Yes | Yes |
| `get_lease_detail` | One lease's full abstract | No | No |
| `get_critical_dates` | Expirations, renewal notices and other deadlines | Yes | Yes |
| `get_expenses` | Rent, opex and capex records and totals | Yes | Yes |
| `search_documents` | Clauses and language in uploaded lease documents | Yes | No |
| `search_help_articles` | How to use Spacebase | No | No |
| `list_accounting_leases` | Accounting leases under ASC 842, IFRS 16 or GASB 87 | Yes | Yes |
| `get_accounting_lease_detail` | One accounting lease's snapshot and modification history | No | No |
| `get_amortization_schedule` | Period-by-period schedule for one accounting lease | Yes | Yes |
| `get_journal_entries` | Journal entries for one accounting lease | Yes | Yes |

Dates passed to any tool use the `YYYY-MM-DD` format. Lease and accounting-lease identifiers (`uid`) come from the list tools, so the assistant usually lists first and then drills in.

## Leases

### list\_leases

Searches, filters and sorts the leases you can see. Returns compact summaries: name, address, region, property type, lease type, expiration date and days until expiration, current monthly rent and cost, square feet, headcount, capacity, status and a link to the lease.

| Parameter | Values | Default | Meaning |
| - | - | - | - |
| `search` | text | — | Matches lease name, address, lessor or lessee |
| `region` | text | — | Region name, for example "Americas" or "EMEA" |
| `city` | text | — | City name |
| `property_type` | text | — | For example "Office" or "Retail" |
| `lease_type` | text | — | Lease type as configured in your company |
| `rent_type` | text | — | For example "NNN" or "Gross" |
| `status` | `active_and_upcoming`, `active`, `expired` | `active_and_upcoming` | Commenced and not-yet-commenced leases, commenced only, or past leases |
| `term_type` | `fixed`, `recurring` | — | Lease term type |
| `lease_expiring_before` | date | — | Only leases expiring on or before this date |
| `lease_expiring_after` | date | — | Only leases expiring on or after this date |
| `sort_by` | `name`, `expiration_date`, `current_cost`, `current_rent`, `current_square_feet`, `current_headcount`, `current_capacity` | — | Sort field |
| `sort_order` | `asc`, `desc` | `asc` | Sort direction |
| `limit`, `offset` | numbers | 50, 0 | See [Paging](#paging) |

Returns `total_count` for the whole match, the current page of `leases`, and the [download links](#downloading-results-as-csv).

### get\_lease\_detail

Returns one lease by `lease_uid`: the summary fields above plus lessor, lessee, dates, term, rent and cost figures, and a `links` block with direct URLs to the lease's expenses, dates, files, areas, contacts and headcount pages.

| Parameter | Values | Default | Meaning |
| - | - | - | - |
| `lease_uid` | identifier | required | From `list_leases` |
| `include` | any of `critical_dates`, `options`, `expense_schedules`, `areas`, `clauses`, `custom_fields`, `contacts`, `headcount` | — | Extra sections to add to the response |

For financial math the assistant is guided to use `get_expenses` rather than the `expense_schedules` section: expense records carry fully resolved amounts, while schedules only describe the structure.

### get\_critical\_dates

Lists critical dates across the portfolio or for one lease, ordered by date. Each row carries the lease name, category, date, `days_remaining` and a link to the lease's dates page.

| Parameter | Values | Default | Meaning |
| - | - | - | - |
| `lease_uid` | identifier | — | Limit to one lease |
| `category` | slug such as `expiration`, `renewal-notice`, `rent-adjustment`, `rent-commencement` | — | Date category |
| `region`, `city`, `property_type` | text | — | Filters on the parent lease |
| `status` | `active_and_upcoming`, `active`, `expired` | `active_and_upcoming` | Lifecycle filter on the parent leases |
| `start_date` | date | today | Start of the window. Use an earlier date to include past dates |
| `end_date` | date | 90 days after `start_date` | End of the window |
| `limit`, `offset` | numbers | 50, 0 | See [Paging](#paging) |

If only `end_date` is given, the window starts 90 days before it. Returns `total_count` for the whole window, `as_of_date`, `through_date`, the page of `dates`, and the download links.

## Expenses

### get\_expenses

Returns individual expense records with rent, opex and capex fully resolved after adjustments, abatements and prepaid credits. This is the tool behind totals by region, trends over time and comparisons between leases.

| Parameter | Values | Default | Meaning |
| - | - | - | - |
| `lease_uids` | list of identifiers | — | Limit to these leases |
| `region`, `city`, `property_type` | text | — | Filters on the lease |
| `expense_type` | `rent`, `opex`, `capex` | — | Expense type |
| `start_date` | date | — | Expenses due on or after this date |
| `end_date` | date | — | Expenses due on or before this date |
| `convert` | `true`, `false` | `true` | Convert every amount to one currency at the latest rate |
| `target_currency` | 3-letter code such as `USD` | your default currency | Currency to convert into when `convert` is true |
| `limit`, `offset` | numbers | 50, 0 | See [Paging](#paging) |

Returns `total_count` and `total_amount` for every matching record, not only the current page, so a simple total never needs paging. When `convert` is false, `total_amount_by_currency` reports a subtotal per currency instead. Lease identifiers that don't exist or that you can't access are listed in `missing_lease_uids` rather than silently dropped.

## Documents and help

### search\_documents

Searches the text of your uploaded lease documents by meaning, not just keywords. Use it for contract language the lease abstract doesn't capture: termination rights, restoration obligations, insurance requirements and similar clauses. Each result includes the matching passage, a citation with file and page, a link to the document and a link to the lease.

| Parameter | Values | Default | Meaning |
| - | - | - | - |
| `query` | text | required | What to look for |
| `lease_uid` | identifier | — | Limit the search to one lease's documents |
| `top_k` | 1 to 10 | 5 | Results per page |
| `offset` | 0 to 50 | 0 | Results to skip |

Results are ranked within a fixed pool of up to 60 candidate passages, so pages are stable slices of one ranking. `total_results` is the number of pageable results in that pool.

Document text is treated as untrusted data. If a page of results looks like it contains instructions aimed at the assistant rather than lease language, Spacebase withholds that page and returns an explanation in `error` instead.

### search\_help\_articles

Searches the Spacebase help library for "how do I" questions about the product itself. It never searches your lease documents.

| Parameter | Values | Default | Meaning |
| - | - | - | - |
| `query` | text | required | Your question about using Spacebase |

## Accounting

### list\_accounting\_leases

Lists your accounting leases under ASC 842, IFRS 16 and GASB 87. Only the standards and review states you're permitted to view are returned. Each row carries the underlying real-estate `lease_uid`, so the assistant can combine accounting data with rent, dates or square footage from `get_lease_detail`.

| Parameter | Values | Default | Meaning |
| - | - | - | - |
| `classification` | `operating`, `finance`, `short-term`, `non-lease` | — | Accounting classification |
| `accounting_standard` | `ASC 842`, `IFRS 16`, `GASB 87` | — | Accounting standard |
| `status` | `approved`, `needs_review`, `reviewed` | — | Review status |
| `limit`, `offset` | numbers | 50, 0 | See [Paging](#paging) |

### get\_accounting\_lease\_detail

Returns one accounting lease by `accounting_lease_uid`: the current snapshot (classification, discount rate, effective and end dates) and the complete `modification_history`. The snapshot identifiers in that history feed the two tools below.

| Parameter | Values | Default | Meaning |
| - | - | - | - |
| `accounting_lease_uid` | identifier | required | From `list_accounting_leases` |

### get\_amortization\_schedule

Returns the period-by-period schedule for one accounting lease: right-of-use asset, lease liability, expense, and interest and amortization components. The table is dynamic, so the response carries `columns` (the header row) and `periods` (the rows). The first row of the full table is the opening balance, which is why `total_count` equals `period_count` plus one.

| Parameter | Values | Default | Meaning |
| - | - | - | - |
| `accounting_lease_uid` | identifier | required | The accounting lease |
| `snapshot_uid` | identifier | snapshot in effect | A prior snapshot from `modification_history` |
| `limit`, `offset` | numbers | 50, 0 | See [Paging](#paging) |

Summary fields such as `discount_rate`, `classification`, `currency` and the effective dates are always present. If the lease has no schedule for the requested snapshot, `error` explains why and `available_snapshots` lists the snapshots that do.

### get\_journal\_entries

Returns journal entries for one accounting lease snapshot in the standard format or one of your company's custom journal-entry formats. Like the schedule, the response carries `columns` and `entries`.

| Parameter | Values | Default | Meaning |
| - | - | - | - |
| `accounting_lease_uid` | identifier | required | The accounting lease |
| `report_format` | `standard`, `standard-no-cash`, or a value from `available_formats` | standard | Journal-entry format |
| `snapshot_uid` | identifier | latest snapshot | A prior snapshot from `modification_history` |
| `limit`, `offset` | numbers | 50, 0 | See [Paging](#paging) |

To use a company-specific format, the assistant calls once, reads `available_formats` from the response, and calls again with one of those values. `error` explains a missing chart of accounts, an unknown format, or a snapshot without entries.

## Paging

List tools return one page at a time. `limit` sets the page size (default 50, maximum 100) and `offset` is the zero-based position of the first row. Every paged response carries `total_count`, `returned_count` and `has_more`, and the assistant advances `offset` while `has_more` is true.

Summary fields always describe the whole filtered set, not the current page. `total_count` in `list_leases` is the number of matching leases, and `total_amount` in `get_expenses` is the sum of every matching record. For simple counts and totals the assistant doesn't need to read every row.

`search_documents` pages differently: `top_k` (up to 10) is the page size and `offset` (up to 50) the position.

## Downloading results as CSV

The six tools marked "CSV download" in the [table above](#tools-at-a-glance) attach two links to every non-empty page. Both point at the complete filtered result, not just the rows the assistant has shown you.

**A download link for you.** Ask the assistant to download, export or save a list or schedule, for example "download this amortization schedule as CSV", and it replies with a link. The link opens in your browser, may ask you to sign in to Spacebase first, and only works for the user and company it was created for. It expires after 24 hours, and results over 50,000 rows aren't offered as a download. Ask for a fresh link if yours has expired.

**A working link for the assistant.** Assistants that can run code, such as Claude Code, Codex and Gemini CLI, receive a second link they can fetch into their own workspace to analyze the full result, for example to total expenses by month across the portfolio. That link is private to the assistant, expires after about 15 minutes, works for only a few fetches, and returns only data you can already see. The assistant is instructed never to show it to you; if one appears in a reply, don't share it.

If a download link doesn't open, the page explains why:

| Message | What to do |
| - | - |
| This export link has expired | The link is older than 24 hours. Ask the assistant for a new one. |
| This export was created while you were signed in to a different company | Switch back to that company in Spacebase and open the link again. |
| Your account no longer has access to Spacebase's AI connector | Ask your administrator to restore the plan, AI module or permission. |
| Too many export downloads | Downloads are limited to 10 a minute and 100 an hour per user. Wait a moment and retry. |
| This export link is no longer valid because Spacebase was updated | A release changed the tool since the link was created. Ask the assistant for a new one. |

## Links back to Spacebase

Every lease, critical date and accounting lease in a result carries an `app_url`, and a lease detail also carries links to its expenses, dates, files, areas, contacts and headcount pages. Assistants are instructed to render each lease name as a link, so you can open the record in Spacebase from the chat.

## Permissions and scope

* Results are limited to the company you're currently signed in to in Spacebase. If you belong to several companies, switching companies changes what the connector returns.
* Lease-level restrictions on your account, such as access to specific regions, countries, cities or leases, apply to every tool.
* Accounting tools return only the accounting standards you can view, and only accounting leases in the review states your permissions allow.
* Nothing is written. Every tool is a read, and the only permission an app can hold is read-only.

## Limits

| Limit | Value |
| - | - |
| Tool calls | 30 a minute and 300 an hour per user |
| Page size | 50 rows by default, 100 at most |
| Document search | 10 results per page, up to 60 results in total |
| CSV downloads | 10 a minute and 100 an hour per user, up to 50,000 rows each |
| Download link lifetime | 24 hours for you, about 15 minutes for the assistant |
| Access | Sign-in token lasts 10 hours and renews automatically for up to 90 days |

When a limit is reached the assistant receives a message that says so, including how long to wait, and relays it to you.


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