Skip to main content

Views, Sharing, and Report Tools

Use these tools to create reusable filtered Views, share records and forms, and build saved reports.

Views​

ToolWhat it does
anydb_list_viewsLists accessible Views with decoded scope, target types, and filters.
anydb_create_viewCreates a filtered workspace View or direct-child View.
anydb_update_viewRenames a View or replaces its complete targets and filters.
anydb_delete_viewPermanently deletes a confirmed View.

Call anydb_list_views before creating a View to avoid duplicates. A workspace View is attached to the workspace root; a children View is attached to a specific parent and filters its direct children.

Views are not type-page tabs

The named filters shown as tabs on a type's listing page are a separate feature. MCP View tools do not read or write those tabs. A created View can be queried by passing its viewId as parentid to list_records and is available from the workspace's saved Views.

Sharing​

ToolWhat it does
anydb_list_team_groupsLists stable group names that can receive private shares.
anydb_list_sharesLists accessible record and form share facets.
anydb_get_shareGets one share facet by shareId and kind, including who it is shared with, its link, its expiry and, for forms, its child forms and settings.
anydb_create_shareCreates a public or private record or form share, optionally with an expiry, and for forms child forms and submission settings.
anydb_update_shareChanges an existing share without recreating it: name, expiry, public link, people, and role or form settings.
anydb_revoke_shareRevokes one record or form share facet while preserving any other facet on the same share.

Call anydb_list_shares before creating a share so existing compatible public links can be reused. Private shares accept email addresses or stable group names returned by anydb_list_team_groups; do not guess internal group IDs.

Record shares can use viewer or editor access and optionally include attachments. Form shares target a stable type name and can identify the parent that receives submissions.

Every share, public or private, returns a url: the link to give people. A public share gets its /s/ (record) or /f/ (form) link, a private record share the "Shared with me" page for the people it is shared with, and a form its /f/ link.

Expiry, child forms and form settings​

When creating a share:

  • expiresAt (YYYY-MM-DD, today or later) sets a date after which the share stops working.
  • For forms, childForms lists child types the submitter fills in together with the form, for example [{ "templateName": "Photo", "min": 1, "max": 4 }] (min defaults to 0 and max to 1).
  • For forms, submissionGrouping (NONE, DAY, WEEK, MONTH or YEAR) files submissions into a folder per period, and submissionNotifications turns the email to the sharer on each submission on or off.

Changing a share​

Use anydb_update_share with the shareId, its kind and a changes object. Only what changes names is changed.

ChangeHow
Renamename
Set or remove the expiryexpiresAt with a date, or null to remove it
Public link on or offprivacy: public turns it on; private turns it off and keeps the named people
Add peopleaddRecipients with emails and/or groupNames
Remove peopleremoveRecipients with the emails they were shared with and/or groupNames
Record share: access levelrole (viewer or editor) and withAttachments, applied to everyone on the share
Form share: child forms and settingschildForms (replaces the list; [] removes them), submissionGrouping, submissionNotifications

Only people newly added are emailed. Removing the last person from a record share deletes it, and the response says so with deleted: true. Adding a person to an existing form share works even when the team is at its form-share limit. Each plan allows a number of form shares; at the limit a new form share is refused with a message that names the limit.

Who can do what​

Every sharing tool runs as the authenticated user and applies the same access rules as the Share dialog:

  • Creating, changing or deleting a share needs permission to share the record (for a form, its parent record). A tool never does more than that user could in the dialog.
  • Only the person who created a record share can change its settings or add people to it.
  • Anyone who can read what a share shares can read the share, but only the person who created it and people who may share the record see who else it is shared with; for everyone else recipients is empty and recipientsHidden is true.
  • A refusal says why: not authorized, not found, or the plan limit.

Workflow scripts can manage shares as well, with createFormShare, updateFormShare, deleteFormShare, getShare and the record-share functions; see AnyDB Scripting.

Reports​

ToolWhat it does
anydb_list_reportsLists saved reports in a workspace with their IDs and names.
anydb_get_reportGets one report's complete definition.
anydb_create_reportValidates or creates a saved grouped and aggregated report over one type.
anydb_update_reportRenames a report, replaces its complete definition, or validates a proposed update.
anydb_delete_reportPermanently deletes a saved report and every snapshot computed for it.
anydb_run_reportRuns a saved report, like the Run button in the Reports tab.
anydb_get_report_resultReads the last computed result without re-running the report.
anydb_export_reportExports the last ready snapshot as CSV text or an XLSX workbook.
anydb_email_reportEmails a report's CSV or XLSX export to people by email address.

Call anydb_list_reports before creating a report to avoid duplicates. Report definitions support:

  • A stable templateName
  • Field and date-bucket grouping by day, week, month, quarter, or year
  • Selected output fields
  • sum, avg, min, max, and count metrics
  • Filter expressions
  • Subtotals and grand totals
  • Candidate-record, group, and cell-document limits
  • IANA time zones for date boundaries

Use validateOnly: true to check a report definition without saving. Sending definition to anydb_update_report replaces the complete definition, so include every setting that must remain.

Run, read, export, and email a report​

A report is computed by a background job, and running it replaces the report's previous snapshot.

  1. Call anydb_run_report. The answer carries a jobId and a status of queued, running, ready, or failed. Pass waitSeconds (up to 60) to wait for the snapshot and receive the result in the same answer.
  2. Otherwise poll anydb_get_report_result until manifest.status is ready. The manifest carries totalGroups, totalMatchedRecords, isTruncated, and grandTotal. Pass groupIndex with start and limit to page one group's detail rows, or skipDetails to leave them out.
  3. Call anydb_export_report with a format of csv or xlsx. It is refused until a snapshot is ready.
  4. Call anydb_email_report to send the export to 1 to 25 email addresses.

anydb_email_report is not a general email tool. The only thing it can send is the export of a report the caller can read, with a fixed AnyDB message that names the caller as the sender. The optional note is the only free text and is shown as plain text. It needs a Business or Enterprise plan, counts against the team's daily email limit, and always reports a refused or over-limit send. It sends the last ready snapshot. Set refresh: true to run the report first: it waits up to 60 seconds and sends nothing if the new snapshot is not ready. Exports over 5 MB are refused, so use CSV or narrow the report.