KosmoKrator

productivity

Google Contacts Lua API for KosmoKrator Agents

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

Lua Namespace

Agents call this integration through app.integrations.google_contacts.*. Use lua_read_doc("integrations.google-contacts") 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 Google Contacts workflow without starting an interactive agent session.

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

Workflow file

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

workflow.lua
local google_contacts = app.integrations.google_contacts
local result = google_contacts.people_search_directory_people({})

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.google_contacts, app.mcp.*, docs.*, json.*, and regex.*. Use app.integrations.google_contacts.default.* or app.integrations.google_contacts.work.* when you configured named credential accounts.

MCP-only Lua

If the script only needs configured MCP servers and does not need Google Contacts, 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.

Google Contacts

Google Contacts tools are exposed under app.integrations.google_contacts. This package is generated from Google’s official People API v1 Discovery document and exposes 24 REST methods.

Coverage

  • Source: https://people.googleapis.com/$discovery/rest?version=v1
  • Read tools: 11
  • Write tools: 13
  • Base URL: https://people.googleapis.com

Usage Notes

Pass resource names such as people/c123, otherContacts/c123, or contactGroups/myContacts exactly as Google documents them. Path parameters named resourceName use reserved expansion so slash-delimited resource names are preserved. Query parameters can be passed as top-level shortcuts or inside query. Create, update, batch, photo, and member-modify methods accept the official JSON request object inside body.

For People API reads, include the required field masks such as personFields, readMask, or sources when the upstream method requires them.

Tools

  • google_contacts_people_search_directory_people - GET /v1/people:searchDirectoryPeople
  • google_contacts_people_delete_contact_photo - DELETE /v1/{+resourceName}:deleteContactPhoto
  • google_contacts_people_batch_delete_contacts - POST /v1/people:batchDeleteContacts
  • google_contacts_people_create_contact - POST /v1/people:createContact
  • google_contacts_people_list_directory_people - GET /v1/people:listDirectoryPeople
  • google_contacts_people_update_contact - PATCH /v1/{+resourceName}:updateContact
  • google_contacts_people_update_contact_photo - PATCH /v1/{+resourceName}:updateContactPhoto
  • google_contacts_people_get - GET /v1/{+resourceName}
  • google_contacts_people_delete_contact - DELETE /v1/{+resourceName}:deleteContact
  • google_contacts_people_get_batch_get - GET /v1/people:batchGet
  • google_contacts_people_batch_update_contacts - POST /v1/people:batchUpdateContacts
  • google_contacts_people_search_contacts - GET /v1/people:searchContacts
  • google_contacts_people_batch_create_contacts - POST /v1/people:batchCreateContacts
  • google_contacts_people_connections_list - GET /v1/{+resourceName}/connections
  • google_contacts_other_contacts_list - GET /v1/otherContacts
  • google_contacts_other_contacts_search - GET /v1/otherContacts:search
  • google_contacts_other_contacts_copy_other_contact_to_my_contacts_group - POST /v1/{+resourceName}:copyOtherContactToMyContactsGroup
  • google_contacts_contact_groups_create - POST /v1/contactGroups
  • google_contacts_contact_groups_get - GET /v1/{+resourceName}
  • google_contacts_contact_groups_list - GET /v1/contactGroups
  • google_contacts_contact_groups_batch_get - GET /v1/contactGroups:batchGet
  • google_contacts_contact_groups_update - PUT /v1/{+resourceName}
  • google_contacts_contact_groups_delete - DELETE /v1/{+resourceName}
  • google_contacts_contact_groups_members_modify - POST /v1/{+resourceName}/members:modify

Examples

local groups = app.integrations.google_contacts.google_contacts_contact_groups_list({ pageSize = 10 })

local contacts = app.integrations.google_contacts.google_contacts_people_connections_list({
  resourceName = "people/me",
  personFields = "names,emailAddresses,phoneNumbers"
})

Responses are decoded Google People API JSON responses, or { success = true, status = ... } for successful empty responses.

Raw agent markdown
# Google Contacts

Google Contacts tools are exposed under `app.integrations.google_contacts`. This package is generated from Google's official People API v1 Discovery document and exposes 24 REST methods.

## Coverage

- Source: `https://people.googleapis.com/$discovery/rest?version=v1`
- Read tools: 11
- Write tools: 13
- Base URL: `https://people.googleapis.com`

## Usage Notes

Pass resource names such as `people/c123`, `otherContacts/c123`, or `contactGroups/myContacts` exactly as Google documents them. Path parameters named `resourceName` use reserved expansion so slash-delimited resource names are preserved. Query parameters can be passed as top-level shortcuts or inside `query`. Create, update, batch, photo, and member-modify methods accept the official JSON request object inside `body`.

For People API reads, include the required field masks such as `personFields`, `readMask`, or `sources` when the upstream method requires them.

## Tools

- `google_contacts_people_search_directory_people` - GET /v1/people:searchDirectoryPeople
- `google_contacts_people_delete_contact_photo` - DELETE /v1/{+resourceName}:deleteContactPhoto
- `google_contacts_people_batch_delete_contacts` - POST /v1/people:batchDeleteContacts
- `google_contacts_people_create_contact` - POST /v1/people:createContact
- `google_contacts_people_list_directory_people` - GET /v1/people:listDirectoryPeople
- `google_contacts_people_update_contact` - PATCH /v1/{+resourceName}:updateContact
- `google_contacts_people_update_contact_photo` - PATCH /v1/{+resourceName}:updateContactPhoto
- `google_contacts_people_get` - GET /v1/{+resourceName}
- `google_contacts_people_delete_contact` - DELETE /v1/{+resourceName}:deleteContact
- `google_contacts_people_get_batch_get` - GET /v1/people:batchGet
- `google_contacts_people_batch_update_contacts` - POST /v1/people:batchUpdateContacts
- `google_contacts_people_search_contacts` - GET /v1/people:searchContacts
- `google_contacts_people_batch_create_contacts` - POST /v1/people:batchCreateContacts
- `google_contacts_people_connections_list` - GET /v1/{+resourceName}/connections
- `google_contacts_other_contacts_list` - GET /v1/otherContacts
- `google_contacts_other_contacts_search` - GET /v1/otherContacts:search
- `google_contacts_other_contacts_copy_other_contact_to_my_contacts_group` - POST /v1/{+resourceName}:copyOtherContactToMyContactsGroup
- `google_contacts_contact_groups_create` - POST /v1/contactGroups
- `google_contacts_contact_groups_get` - GET /v1/{+resourceName}
- `google_contacts_contact_groups_list` - GET /v1/contactGroups
- `google_contacts_contact_groups_batch_get` - GET /v1/contactGroups:batchGet
- `google_contacts_contact_groups_update` - PUT /v1/{+resourceName}
- `google_contacts_contact_groups_delete` - DELETE /v1/{+resourceName}
- `google_contacts_contact_groups_members_modify` - POST /v1/{+resourceName}/members:modify

## Examples

```lua
local groups = app.integrations.google_contacts.google_contacts_contact_groups_list({ pageSize = 10 })

local contacts = app.integrations.google_contacts.google_contacts_people_connections_list({
  resourceName = "people/me",
  personFields = "names,emailAddresses,phoneNumbers"
})
```

Responses are decoded Google People API JSON responses, or `{ success = true, status = ... }` for successful empty responses.
Metadata-derived Lua example
local result = app.integrations.google_contacts.people_search_directory_people({})
print(result)

Functions

people_search_directory_people Read

People Search Directory People (GET /v1/people:searchDirectoryPeople).

Lua path
app.integrations.google_contacts.people_search_directory_people
Full name
google-contacts.google_contacts_people_search_directory_people
ParameterTypeRequiredDescription
No parameters.
people_delete_photo Write

People Delete Contact Photo (DELETE /v1/{+resourceName}:deleteContactPhoto).

Lua path
app.integrations.google_contacts.people_delete_photo
Full name
google-contacts.google_contacts_people_delete_contact_photo
ParameterTypeRequiredDescription
No parameters.
people_batch_delete Write

People Batch Delete Contacts (POST /v1/people:batchDeleteContacts).

Lua path
app.integrations.google_contacts.people_batch_delete
Full name
google-contacts.google_contacts_people_batch_delete_contacts
ParameterTypeRequiredDescription
No parameters.
people_create Write

People Create Contact (POST /v1/people:createContact).

Lua path
app.integrations.google_contacts.people_create
Full name
google-contacts.google_contacts_people_create_contact
ParameterTypeRequiredDescription
No parameters.
people_list_directory_people Read

People List Directory People (GET /v1/people:listDirectoryPeople).

Lua path
app.integrations.google_contacts.people_list_directory_people
Full name
google-contacts.google_contacts_people_list_directory_people
ParameterTypeRequiredDescription
No parameters.
people_update Write

People Update Contact (PATCH /v1/{+resourceName}:updateContact).

Lua path
app.integrations.google_contacts.people_update
Full name
google-contacts.google_contacts_people_update_contact
ParameterTypeRequiredDescription
No parameters.
people_update_photo Write

People Update Contact Photo (PATCH /v1/{+resourceName}:updateContactPhoto).

Lua path
app.integrations.google_contacts.people_update_photo
Full name
google-contacts.google_contacts_people_update_contact_photo
ParameterTypeRequiredDescription
No parameters.
people_get Read

People Get (GET /v1/{+resourceName}).

Lua path
app.integrations.google_contacts.people_get
Full name
google-contacts.google_contacts_people_get
ParameterTypeRequiredDescription
No parameters.
people_delete Write

People Delete Contact (DELETE /v1/{+resourceName}:deleteContact).

Lua path
app.integrations.google_contacts.people_delete
Full name
google-contacts.google_contacts_people_delete_contact
ParameterTypeRequiredDescription
No parameters.
people_get_batch_get Read

People Get Batch Get (GET /v1/people:batchGet).

Lua path
app.integrations.google_contacts.people_get_batch_get
Full name
google-contacts.google_contacts_people_get_batch_get
ParameterTypeRequiredDescription
No parameters.
people_batch_update Write

People Batch Update Contacts (POST /v1/people:batchUpdateContacts).

Lua path
app.integrations.google_contacts.people_batch_update
Full name
google-contacts.google_contacts_people_batch_update_contacts
ParameterTypeRequiredDescription
No parameters.
people_batch_create Write

People Batch Create Contacts (POST /v1/people:batchCreateContacts).

Lua path
app.integrations.google_contacts.people_batch_create
Full name
google-contacts.google_contacts_people_batch_create_contacts
ParameterTypeRequiredDescription
No parameters.
people_connections_list Read

People Connections List (GET /v1/{+resourceName}/connections).

Lua path
app.integrations.google_contacts.people_connections_list
Full name
google-contacts.google_contacts_people_connections_list
ParameterTypeRequiredDescription
No parameters.
other_list Read

Other Contacts List (GET /v1/otherContacts).

Lua path
app.integrations.google_contacts.other_list
Full name
google-contacts.google_contacts_other_contacts_list
ParameterTypeRequiredDescription
No parameters.
other_copy_other_my_group Write

Other Contacts Copy Other Contact To My Contacts Group (POST /v1/{+resourceName}:copyOtherContactToMyContactsGroup).

Lua path
app.integrations.google_contacts.other_copy_other_my_group
Full name
google-contacts.google_contacts_other_contacts_copy_other_contact_to_my_contacts_group
ParameterTypeRequiredDescription
No parameters.
groups_create Write

Contact Groups Create (POST /v1/contactGroups).

Lua path
app.integrations.google_contacts.groups_create
Full name
google-contacts.google_contacts_contact_groups_create
ParameterTypeRequiredDescription
No parameters.
groups_get Read

Contact Groups Get (GET /v1/{+resourceName}).

Lua path
app.integrations.google_contacts.groups_get
Full name
google-contacts.google_contacts_contact_groups_get
ParameterTypeRequiredDescription
No parameters.
groups_list Read

Contact Groups List (GET /v1/contactGroups).

Lua path
app.integrations.google_contacts.groups_list
Full name
google-contacts.google_contacts_contact_groups_list
ParameterTypeRequiredDescription
No parameters.
groups_batch_get Read

Contact Groups Batch Get (GET /v1/contactGroups:batchGet).

Lua path
app.integrations.google_contacts.groups_batch_get
Full name
google-contacts.google_contacts_contact_groups_batch_get
ParameterTypeRequiredDescription
No parameters.
groups_update Write

Contact Groups Update (PUT /v1/{+resourceName}).

Lua path
app.integrations.google_contacts.groups_update
Full name
google-contacts.google_contacts_contact_groups_update
ParameterTypeRequiredDescription
No parameters.
groups_delete Write

Contact Groups Delete (DELETE /v1/{+resourceName}).

Lua path
app.integrations.google_contacts.groups_delete
Full name
google-contacts.google_contacts_contact_groups_delete
ParameterTypeRequiredDescription
No parameters.
groups_members_modify Write

Contact Groups Members Modify (POST /v1/{+resourceName}/members:modify).

Lua path
app.integrations.google_contacts.groups_members_modify
Full name
google-contacts.google_contacts_contact_groups_members_modify
ParameterTypeRequiredDescription
No parameters.