skills/konecty-find/SKILL.md
Searches and queries records in Konecty modules using the REST API. Supports simple document find (/rest/data/:document/find with GET or POST), cross-module JSON queries with relations and aggregators (/rest/query/json), and SQL queries (/rest/query/sql). Use when the user wants to search, list, filter, or query records in any Konecty module; needs to filter by field values (equals, contains, between, greater_than, in, exists, etc.); wants to join related documents and aggregate data (count, sum, avg); or needs pagination and sorting. Requires an active konecty-session (KONECTY_URL and KONECTY_TOKEN in ~/.konecty/.env). For unknown modules or field names, use konecty-modules first.
npx skillsauth add konecty/skills konecty-findInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Search and query records in any Konecty module.
Requires credentials from konecty-session: KONECTY_URL and KONECTY_TOKEN in ~/.konecty/.env.
If not present or expired, ask the user to run konecty-session first.
If the module name or field names are unknown, use konecty-modules to discover them.
| Endpoint | Method | Description |
|----------|--------|-------------|
| /rest/data/:document/find | GET / POST | Simple document search |
| /rest/query/json | POST | Cross-module query with relations and aggregators |
| /rest/query/sql | POST | SQL query (translated to JSON query internally) |
python3 scripts/find.py find <Document> [options] # simple find
python3 scripts/find.py query <Document> [options] # cross-module JSON query
python3 scripts/find.py sql "<SQL>" [options] # SQL query
All subcommands accept --host and --token to override credentials, and --output json|ndjson.
find options| Option | Description |
|--------|-------------|
| --filter '<JSON>' | KonFilter as JSON string |
| --fields 'f1,f2' | Comma-separated field names to return |
| --sort 'field:asc' | Sort shorthand or JSON array |
| --limit N | Max records (default: 50, -1 for no limit) |
| --start N | Offset/skip for pagination (default: 0) |
| --post | Force POST even without filter |
query optionsSame as find, plus:
| Option | Description |
|--------|-------------|
| --relations '<JSON>' | Relations array as JSON string |
| --include-meta | Request _meta line as first NDJSON record |
| --no-total | Skip total count calculation (faster) |
python3 scripts/find.py find Contact \
--filter '{"match":"and","conditions":[{"term":"status","operator":"equals","value":"active"}]}' \
--fields "code,name,status" --limit 20
python3 scripts/find.py find Contact \
--filter '{"match":"and","textSearch":"John Doe"}' \
--fields "code,name,email"
python3 scripts/find.py find Opportunity \
--filter '{"match":"and","conditions":[{"term":"createdAt","operator":"between","value":{"greater_or_equals":"$monthsAgo:3","less_or_equals":"$now"}}]}'
python3 scripts/find.py find Opportunity \
--filter '{"match":"and","conditions":[{"term":"contact._id","operator":"equals","value":"<contactId>"}]}'
python3 scripts/find.py query Contact \
--fields "code,name" \
--relations '[{"document":"Opportunity","lookup":"contact","aggregators":{"count":{"aggregator":"count"},"totalValue":{"aggregator":"sum","field":"value.value"}}}]' \
--limit 100
python3 scripts/find.py sql \
"SELECT ct.code, ct.name, COUNT(o._id) AS deals FROM Contact ct INNER JOIN Opportunity o ON ct._id = o.contact._id GROUP BY ct.code, ct.name ORDER BY deals DESC LIMIT 50"
# Page 1
python3 scripts/find.py find Contact --limit 50 --start 0
# Page 2
python3 scripts/find.py find Contact --limit 50 --start 50
{
"match": "and",
"conditions": [
{ "term": "status", "operator": "equals", "value": "active" }
],
"textSearch": "optional full-text string",
"filters": [
{ "match": "or", "conditions": [...] }
]
}
match: "and" | "or" — how to combine conditionsconditions: array of { term, operator, value } objectstextSearch: full-text search across indexed text fieldsfilters: nested sub-groups for complex AND/OR combinations"disabled": true is ignored at runtime| Operator | Use for |
|----------|---------|
| equals / not_equals | Exact match |
| contains / not_contains | Substring (case-insensitive) |
| starts_with / end_with | Prefix / suffix |
| in / not_in | Match/exclude a list — value must be an array |
| greater_than / less_than | Numeric/date comparison |
| greater_or_equals / less_or_equals | Inclusive numeric/date comparison |
| between | Inclusive range — value: { "greater_or_equals": ..., "less_or_equals": ... } |
| exists | Field presence — value: true or false |
For the full operator list, field-type matrix, dot-notation for sub-fields, and dynamic date variables ($now, $monthsAgo:N, $user, etc.), see references/filter-operators.md.
/rest/data/:document/find returns JSON:
{ "success": true, "total": 120, "data": [...] }
/rest/query/json and /rest/query/sql return NDJSON (application/x-ndjson), one object per line. With includeMeta: true, the first line is { "_meta": { "success": true, "total": N } }.
The script prints # Total: N Returned: N to stderr and the data to stdout, making it easy to pipe: python3 scripts/find.py find Contact | jq ..
query/json schema, relations, aggregators, groupBy, SQL interfacedata-ai
Replace with description of the skill and when the agent should use it.
tools
Upload, list, and delete files in Konecty document fields via the file API. Use this skill whenever the user wants to attach a file to a Konecty record, upload a photo/image to a contact or product, add a PDF or document to an opportunity, send a curriculum to a candidate, manage gallery images for a development or promotion, or attach any binary file to any Konecty module field. Also triggers when the user says 'upload', 'anexar', 'enviar arquivo', 'adicionar imagem', 'attach file', or refers to file-type fields in any document. Automatically reads field constraints (accepted extensions, max size, max file count) from metadata before uploading to catch errors early. Requires an active konecty-session (KONECTY_URL and KONECTY_TOKEN in ~/.konecty/.env or ~/.konecty/credentials).
documentation
Updates records in any Konecty module via PUT /rest/data/:document. Enforces the mandatory pre-update fetch workflow: always fetch the current record first to obtain its _updatedAt (optimistic locking guard), then PUT with ids=[{_id, _updatedAt}] and data={changed fields}. Use when the user wants to update, edit, change, or modify any record in Konecty. Requires an active konecty-session. Use konecty-modules to discover field names and types before updating.
development
Opens a Konecty session via OTP login (request OTP, then verify OTP) and persists the access token in .env or ~/.konecty/credentials for use by other skills. Use when the user wants to log in to Konecty with OTP, store credentials, set up KONECTY_TOKEN, or establish a session so other Konecty skills can call the API. Only works when the namespace has OTP enabled (email or WhatsApp).