KosmoKrator

data

Crossref Lua API for KosmoKrator Agents

Agent-facing Lua documentation and function reference for the Crossref KosmoKrator integration.

Lua Namespace

Agents call this integration through app.integrations.crossref.*. Use lua_read_doc("integrations.crossref") inside KosmoKrator to discover the same reference at runtime.

Call Lua from the Headless CLI

Use kosmo integrations:lua when a shell script, CI job, cron job, or another coding CLI should run a deterministic Crossref workflow without starting an interactive agent session.

Inline Lua call
kosmo integrations:lua --eval 'dump(app.integrations.crossref.list_works({}))' --json
Read Lua docs headlessly
kosmo integrations:lua --eval 'print(docs.read("crossref"))' --json
kosmo integrations:lua --eval 'print(docs.read("crossref.list_works"))' --json

Workflow file

Put repeatable logic in a Lua file, then execute it with JSON output for the calling process.

workflow.lua
local crossref = app.integrations.crossref
local result = crossref.list_works({})

dump(result)
Run the workflow
kosmo integrations:lua workflow.lua --json
kosmo integrations:lua workflow.lua --force --json
Namespace note. integrations:lua exposes app.integrations.crossref, app.mcp.*, docs.*, json.*, and regex.*. Use app.integrations.crossref.default.* or app.integrations.crossref.work.* when you configured named credential accounts.

MCP-only Lua

If the script only needs configured MCP servers and does not need Crossref, use the narrower mcp:lua command.

MCP Lua command
# Use mcp:lua for MCP-only scripts; use integrations:lua for this integration namespace.
kosmo mcp:lua --eval 'dump(mcp.servers())' --json

Agent-Facing Lua Docs

This is the rendered version of the full Lua documentation exposed to agents when they inspect the integration namespace.

Crossref

Namespace: crossref

Crossref provides public scholarly metadata through its REST API. No API key is required. Pass mailto on list requests to identify your client and use Crossref’s polite pool.

Works

local works = crossref.list_works({
  query = "large language models",
  rows = 10,
  filter = {
    type = "journal-article",
    ["from-pub-date"] = "2024-01-01",
  },
  mailto = "[email protected]",
})

local work = crossref.get_work({
  doi = "10.1128/mbio.01735-25",
})

Use crossref_get_work_agency to identify whether a DOI is registered with Crossref, DataCite, or another agency.

Scoped Works

Crossref supports work lists scoped by journal, member, prefix, funder, and work type:

  • crossref_list_journal_works
  • crossref_list_member_works
  • crossref_list_prefix_works
  • crossref_list_funder_works
  • crossref_list_type_works

These tools accept the same common list parameters as crossref_list_works, including rows, offset, cursor, filter, select, sort, order, facet, sample, and mailto.

Reference Data

Use the list/get tools for Crossref reference entities:

  • journals
  • members
  • prefixes
  • funders
  • types
  • licenses
local journal = crossref.get_journal({ issn = "0306-4530" })
local member = crossref.get_member({ id = "98" })
local prefix = crossref.get_prefix({ prefix = "10.5555" })
local article_type = crossref.get_type({ id = "journal-article" })

Return Shape

The integration returns Crossref JSON directly. Successful responses usually contain:

  • status
  • message-type
  • message-version
  • message

Filters can be sent as a raw Crossref filter string or as a Lua table; tables are converted to filter:value comma syntax.

Raw agent markdown
# Crossref

Namespace: `crossref`

Crossref provides public scholarly metadata through its REST API. No API key is required. Pass `mailto` on list requests to identify your client and use Crossref's polite pool.

## Works

```lua
local works = crossref.list_works({
  query = "large language models",
  rows = 10,
  filter = {
    type = "journal-article",
    ["from-pub-date"] = "2024-01-01",
  },
  mailto = "[email protected]",
})

local work = crossref.get_work({
  doi = "10.1128/mbio.01735-25",
})
```

Use `crossref_get_work_agency` to identify whether a DOI is registered with Crossref, DataCite, or another agency.

## Scoped Works

Crossref supports work lists scoped by journal, member, prefix, funder, and work type:

- `crossref_list_journal_works`
- `crossref_list_member_works`
- `crossref_list_prefix_works`
- `crossref_list_funder_works`
- `crossref_list_type_works`

These tools accept the same common list parameters as `crossref_list_works`, including `rows`, `offset`, `cursor`, `filter`, `select`, `sort`, `order`, `facet`, `sample`, and `mailto`.

## Reference Data

Use the list/get tools for Crossref reference entities:

- journals
- members
- prefixes
- funders
- types
- licenses

```lua
local journal = crossref.get_journal({ issn = "0306-4530" })
local member = crossref.get_member({ id = "98" })
local prefix = crossref.get_prefix({ prefix = "10.5555" })
local article_type = crossref.get_type({ id = "journal-article" })
```

## Return Shape

The integration returns Crossref JSON directly. Successful responses usually contain:

- `status`
- `message-type`
- `message-version`
- `message`

Filters can be sent as a raw Crossref filter string or as a Lua table; tables are converted to `filter:value` comma syntax.
Metadata-derived Lua example
local result = app.integrations.crossref.list_works({})
print(result)

Functions

list_works Read

List, search, filter, facet, sample, or page Crossref works.

Lua path
app.integrations.crossref.list_works
Full name
crossref.crossref_list_works
ParameterTypeRequiredDescription
No parameters.
get_work Read

Get one Crossref work by DOI.

Lua path
app.integrations.crossref.get_work
Full name
crossref.crossref_get_work
ParameterTypeRequiredDescription
No parameters.
get_work_agency Read

Get DOI registration agency.

Lua path
app.integrations.crossref.get_work_agency
Full name
crossref.crossref_get_work_agency
ParameterTypeRequiredDescription
No parameters.
list_journals Read

List Crossref journals.

Lua path
app.integrations.crossref.list_journals
Full name
crossref.crossref_list_journals
ParameterTypeRequiredDescription
No parameters.
get_journal Read

Get journal details by ISSN.

Lua path
app.integrations.crossref.get_journal
Full name
crossref.crossref_get_journal
ParameterTypeRequiredDescription
No parameters.
journal_works Read

List works in a journal.

Lua path
app.integrations.crossref.journal_works
Full name
crossref.crossref_list_journal_works
ParameterTypeRequiredDescription
No parameters.
list_members Read

List Crossref members.

Lua path
app.integrations.crossref.list_members
Full name
crossref.crossref_list_members
ParameterTypeRequiredDescription
No parameters.
get_member Read

Get member details.

Lua path
app.integrations.crossref.get_member
Full name
crossref.crossref_get_member
ParameterTypeRequiredDescription
No parameters.
member_works Read

List works for a member.

Lua path
app.integrations.crossref.member_works
Full name
crossref.crossref_list_member_works
ParameterTypeRequiredDescription
No parameters.
get_prefix Read

Get prefix steward.

Lua path
app.integrations.crossref.get_prefix
Full name
crossref.crossref_get_prefix
ParameterTypeRequiredDescription
No parameters.
prefix_works Read

List works for a prefix.

Lua path
app.integrations.crossref.prefix_works
Full name
crossref.crossref_list_prefix_works
ParameterTypeRequiredDescription
No parameters.
list_funders Read

List funders.

Lua path
app.integrations.crossref.list_funders
Full name
crossref.crossref_list_funders
ParameterTypeRequiredDescription
No parameters.
get_funder Read

Get funder details.

Lua path
app.integrations.crossref.get_funder
Full name
crossref.crossref_get_funder
ParameterTypeRequiredDescription
No parameters.
funder_works Read

List works for a funder.

Lua path
app.integrations.crossref.funder_works
Full name
crossref.crossref_list_funder_works
ParameterTypeRequiredDescription
No parameters.
list_types Read

List work types.

Lua path
app.integrations.crossref.list_types
Full name
crossref.crossref_list_types
ParameterTypeRequiredDescription
No parameters.
get_type Read

Get work type details.

Lua path
app.integrations.crossref.get_type
Full name
crossref.crossref_get_type
ParameterTypeRequiredDescription
No parameters.
type_works Read

List works for a type.

Lua path
app.integrations.crossref.type_works
Full name
crossref.crossref_list_type_works
ParameterTypeRequiredDescription
No parameters.
list_licenses Read

List licenses.

Lua path
app.integrations.crossref.list_licenses
Full name
crossref.crossref_list_licenses
ParameterTypeRequiredDescription
No parameters.