data
Europe PMC Lua API for KosmoKrator Agents
Agent-facing Lua documentation and function reference for the Europe PMC KosmoKrator integration.Lua Namespace
Agents call this integration through app.integrations.europe_pmc.*.
Use lua_read_doc("integrations.europe-pmc") 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
Europe PMC workflow without starting an interactive agent session.
kosmo integrations:lua --eval 'dump(app.integrations.europe_pmc.search({}))' --json kosmo integrations:lua --eval 'print(docs.read("europe-pmc"))' --json
kosmo integrations:lua --eval 'print(docs.read("europe-pmc.search"))' --json Workflow file
Put repeatable logic in a Lua file, then execute it with JSON output for the calling process.
local europe_pmc = app.integrations.europe_pmc
local result = europe_pmc.search({})
dump(result) kosmo integrations:lua workflow.lua --json
kosmo integrations:lua workflow.lua --force --json integrations:lua exposes app.integrations.europe_pmc, app.mcp.*, docs.*, json.*, and regex.*. Use app.integrations.europe_pmc.default.* or app.integrations.europe_pmc.work.* when you configured named credential accounts.
MCP-only Lua
If the script only needs configured MCP servers and does not need Europe PMC, use the narrower 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.
Europe PMC
Namespace: europe-pmc
Europe PMC provides public APIs for life-sciences publications, full-text XML, citations and references, database links, annotations, and GRIST grant data. No credentials are required.
Publication Search
Use europe_pmc_search for normal queries and europe_pmc_search_post for long queries.
local results = europe_pmc.search({
query = 'TITLE:"large language model" AND OPEN_ACCESS:Y',
resultType = "core",
pageSize = 25,
cursorMark = "*",
})
Common resultType values are idlist, lite, and core. format defaults to json; XML and Dublin Core are available where Europe PMC supports them.
Article Metadata
local article = europe_pmc.article({
source = "MED",
id = "28585529",
resultType = "core",
})
Use source values from Europe PMC such as MED, PMC, AGR, or PAT.
Citation Network And Links
local refs = europe_pmc.references({ source = "MED", id = "28585529" })
local cited_by = europe_pmc.citations({ source = "MED", id = "28585529" })
local db_links = europe_pmc.database_links({ source = "MED", id = "28585529" })
local scholix = europe_pmc.data_links({ source = "MED", id = "28585529" })
europe_pmc_labs_links returns external links supplied by third-party providers. europe_pmc_evaluations returns evaluations when Europe PMC has them for the article.
Full Text
local xml = europe_pmc.full_text_xml({ id = "PMC1664601" })
Full-text and book XML responses are parsed under xml. Supplementary files may return a zip/binary body, exposed as body with content_type.
Fields, Profiles, Metrics
local fields = europe_pmc.fields({})
local profile = europe_pmc.profile({ query = "malaria" })
local metrics = europe_pmc.metrics({})
Use fields to discover query fields before building advanced searches.
Annotations
local annotations = europe_pmc.annotations_by_article_ids({
articleIds = { "MED:28585529", "PMC:PMC1664601" },
type = "Chemicals",
})
Other annotation tools query by entity, provider, relationship, or section/type. europe_pmc_annotations_by_section_or_type requires at least section or type.
Grants
Use europe_pmc_grants_search for GRIST grant data.
local grants = europe_pmc.grants_search({
query = 'ga:"Wellcome Trust" pi:smith',
resultType = "core",
page = 1,
})
GRIST fielded search examples include gid:083611, title:cancer, pi:smith, aff:Cambridge, and epmc_funders:yes.
Raw agent markdown
# Europe PMC
Namespace: `europe-pmc`
Europe PMC provides public APIs for life-sciences publications, full-text XML, citations and references, database links, annotations, and GRIST grant data. No credentials are required.
## Publication Search
Use `europe_pmc_search` for normal queries and `europe_pmc_search_post` for long queries.
```lua
local results = europe_pmc.search({
query = 'TITLE:"large language model" AND OPEN_ACCESS:Y',
resultType = "core",
pageSize = 25,
cursorMark = "*",
})
```
Common `resultType` values are `idlist`, `lite`, and `core`. `format` defaults to `json`; XML and Dublin Core are available where Europe PMC supports them.
## Article Metadata
```lua
local article = europe_pmc.article({
source = "MED",
id = "28585529",
resultType = "core",
})
```
Use `source` values from Europe PMC such as `MED`, `PMC`, `AGR`, or `PAT`.
## Citation Network And Links
```lua
local refs = europe_pmc.references({ source = "MED", id = "28585529" })
local cited_by = europe_pmc.citations({ source = "MED", id = "28585529" })
local db_links = europe_pmc.database_links({ source = "MED", id = "28585529" })
local scholix = europe_pmc.data_links({ source = "MED", id = "28585529" })
```
`europe_pmc_labs_links` returns external links supplied by third-party providers. `europe_pmc_evaluations` returns evaluations when Europe PMC has them for the article.
## Full Text
```lua
local xml = europe_pmc.full_text_xml({ id = "PMC1664601" })
```
Full-text and book XML responses are parsed under `xml`. Supplementary files may return a zip/binary body, exposed as `body` with `content_type`.
## Fields, Profiles, Metrics
```lua
local fields = europe_pmc.fields({})
local profile = europe_pmc.profile({ query = "malaria" })
local metrics = europe_pmc.metrics({})
```
Use `fields` to discover query fields before building advanced searches.
## Annotations
```lua
local annotations = europe_pmc.annotations_by_article_ids({
articleIds = { "MED:28585529", "PMC:PMC1664601" },
type = "Chemicals",
})
```
Other annotation tools query by entity, provider, relationship, or section/type. `europe_pmc_annotations_by_section_or_type` requires at least `section` or `type`.
## Grants
Use `europe_pmc_grants_search` for GRIST grant data.
```lua
local grants = europe_pmc.grants_search({
query = 'ga:"Wellcome Trust" pi:smith',
resultType = "core",
page = 1,
})
```
GRIST fielded search examples include `gid:083611`, `title:cancer`, `pi:smith`, `aff:Cambridge`, and `epmc_funders:yes`. local result = app.integrations.europe_pmc.search({})
print(result) Functions
search Read
Search Europe PMC publications with GET /search.
- Lua path
app.integrations.europe_pmc.search- Full name
europe-pmc.europe_pmc_search
| Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
search_post Read
Search Europe PMC publications with POST /searchPOST for long queries.
- Lua path
app.integrations.europe_pmc.search_post- Full name
europe-pmc.europe_pmc_search_post
| Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
article Read
Get one article by source and external ID.
- Lua path
app.integrations.europe_pmc.article- Full name
europe-pmc.europe_pmc_article
| Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
references Read
List publications referenced by an article.
- Lua path
app.integrations.europe_pmc.references- Full name
europe-pmc.europe_pmc_references
| Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
citations Read
List publications citing an article.
- Lua path
app.integrations.europe_pmc.citations- Full name
europe-pmc.europe_pmc_citations
| Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
database_links Read
List biological database cross-references for an article.
- Lua path
app.integrations.europe_pmc.database_links- Full name
europe-pmc.europe_pmc_database_links
| Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
labs_links Read
List third-party external links for an article.
- Lua path
app.integrations.europe_pmc.labs_links- Full name
europe-pmc.europe_pmc_labs_links
| Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
data_links Read
Return consolidated Scholix data-literature links.
- Lua path
app.integrations.europe_pmc.data_links- Full name
europe-pmc.europe_pmc_data_links
| Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
evaluations Read
Get evaluations for an article.
- Lua path
app.integrations.europe_pmc.evaluations- Full name
europe-pmc.europe_pmc_evaluations
| Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
full_text_xml Read
Retrieve Open Access full-text XML by article ID.
- Lua path
app.integrations.europe_pmc.full_text_xml- Full name
europe-pmc.europe_pmc_full_text_xml
| Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
book_xml Read
Retrieve bookshelf XML by article ID.
- Lua path
app.integrations.europe_pmc.book_xml- Full name
europe-pmc.europe_pmc_book_xml
| Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
supplementary_files Read
Retrieve supplementary file archive for an article when available.
- Lua path
app.integrations.europe_pmc.supplementary_files- Full name
europe-pmc.europe_pmc_supplementary_files
| Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
fields Read
List indexed search fields.
- Lua path
app.integrations.europe_pmc.fields- Full name
europe-pmc.europe_pmc_fields
| Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
profile Read
Get result-count profiles by publication type and source.
- Lua path
app.integrations.europe_pmc.profile- Full name
europe-pmc.europe_pmc_profile
| Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
metrics Read
Read Europe PMC service metrics.
- Lua path
app.integrations.europe_pmc.metrics- Full name
europe-pmc.europe_pmc_metrics
| Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
status_update_search Read
Search article status updates.
- Lua path
app.integrations.europe_pmc.status_update_search- Full name
europe-pmc.europe_pmc_status_update_search
| Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
annotations_by_articles Read
Get annotations for one or more article IDs.
- Lua path
app.integrations.europe_pmc.annotations_by_articles- Full name
europe-pmc.europe_pmc_annotations_by_article_ids
| Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
annotations_by_entity Read
Find annotations tagging a specific entity.
- Lua path
app.integrations.europe_pmc.annotations_by_entity- Full name
europe-pmc.europe_pmc_annotations_by_entity
| Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
annotations_by_provider Read
Find annotations supplied by a provider.
- Lua path
app.integrations.europe_pmc.annotations_by_provider- Full name
europe-pmc.europe_pmc_annotations_by_provider
| Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
annotations_by_relationship Read
Find relationship annotations between two entities.
- Lua path
app.integrations.europe_pmc.annotations_by_relationship- Full name
europe-pmc.europe_pmc_annotations_by_relationship
| Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
annotations_by_section_or_type Read
Find annotations by article section and/or annotation type.
- Lua path
app.integrations.europe_pmc.annotations_by_section_or_type- Full name
europe-pmc.europe_pmc_annotations_by_section_or_type
| Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
grants_search Read
Search the GRIST grants database.
- Lua path
app.integrations.europe_pmc.grants_search- Full name
europe-pmc.europe_pmc_grants_search
| Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||