> For the complete documentation index, see [llms.txt](https://gscripts.gitbook.io/gscripts-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://gscripts.gitbook.io/gscripts-docs/gs-citations/integrations-and-mdt.md). Agents can also search and read this documentation through its [MCP server](https://gscripts.gitbook.io/gscripts-docs/~gitbook/mcp).

# Integrations and MDT

No MDT dependency is required. References are consistent across paper, inventory metadata and the station register.

### Server exports

```
local citation = exports.gs_citations:GetCitation('Citation-000001BT')
local rows = exports.gs_citations:SearchCitations('John Smi', 1)
```

GetCitation returns the current public record or nil when missing/deleted. SearchCitations searches active unpaid names/references and returns one bounded page. These are server-only APIs; an MDT must validate its own officer permissions before exposing them to clients.

### Server events

```
AddEventHandler('gs_citations:created', function(record)
    -- Save your own MDT entry using record.id as its external reference.
end)
AddEventHandler('gs_citations:changed', function(record)
    -- Update your MDT status; retain your own history if desired.
end)
```

Automatic settlement can emit a change before the creation notification. Integrations should upsert by reference instead of assuming event order. Changed records are emitted for payment/deletion before final cleanup. Do not forward the full trusted event payload to arbitrary clients; it can include internal character keys.

### Custom server adapters

Config.Custom defaults to nil for each hook. identity(source) supplies a stable character key and name. officer(source) returns allowed and mayVoid booleans. resolveName(fullName) returns the same key format, canonical name and optional online source; nil means no unique match.

debit(source, account, amount, allowNegative, citationId) must return true only after a confirmed debit, false only when no debit occurred. Throw an error for an uncertain outcome so the review marker blocks a repeat charge. Keep all checks on the server and never put credentials in shared config.

### Editable files

config.lua, html and item images are excluded from Lua protection. Built-in adapter implementations remain in protected client/server files; configure the supported options or custom hooks instead of editing those files.

### Limits

There is no ready-made connector for every MDT, no automatic MDT citation import and no parking/vehicle attachment in this release. ox\_target is an optional desk adapter; qb-target is not included.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://gscripts.gitbook.io/gscripts-docs/gs-citations/integrations-and-mdt.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
