Skip to content

feat: Add Tables app support (tables, columns, rows CRUD)#156

Open
Pavlinchen wants to merge 2 commits intonextcloud:mainfrom
Pavlinchen:feat/tables-support
Open

feat: Add Tables app support (tables, columns, rows CRUD)#156
Pavlinchen wants to merge 2 commits intonextcloud:mainfrom
Pavlinchen:feat/tables-support

Conversation

@Pavlinchen
Copy link
Copy Markdown
Contributor

@Pavlinchen Pavlinchen commented Apr 22, 2026

Summary

  • Adds a new tables.py tool module with 12 MCP tools for the Nextcloud Tables app
  • Full CRUD for tables, columns, and rows
  • Column creation supports all 5 column types with type-specific parameters
  • Uses the Tables REST API v1 (/index.php/apps/tables/api/1/)

Motivation

The Tables app is one of the most-used Nextcloud apps for structured data (spreadsheet-like tables). It is currently not supported by the Context Agent, meaning the AI assistant cannot read, create, or modify table data. This is a significant gap for users who manage data in Tables alongside Deck, Calendar, and other supported apps.

Implementation Details

Disclaimer

Implementation from a technical perspective was done mainly by a LLM (Claude Opus 4.7 max effort).
Every tool and endpoint response shape was validated end-to-end against Nextcloud 32.0.8 + Tables 1.0.5, with a full lifecycle smoke test completed before opening the PR.

Follows the same patterns as deck.py, cookbook.py, and bookmarks.py:

  • Uses nc._session._create_adapter().request() for REST API calls
  • @safe_tool for read operations, @dangerous_tool for mutations
  • is_available checks 'tables' in await nc.capabilities

Tools

Tool Type Endpoint
list_tables safe GET /api/1/tables
create_table dangerous POST /api/1/tables
update_table dangerous PUT /api/1/tables/{tableId}
delete_table dangerous DELETE /api/1/tables/{tableId}
list_columns safe GET /api/1/tables/{tableId}/columns
create_column dangerous POST /api/1/tables/{tableId}/columns
update_column dangerous PUT /api/1/columns/{columnId}
delete_column dangerous DELETE /api/1/columns/{columnId}
list_rows safe GET /api/1/tables/{tableId}/rows
create_row dangerous POST /api/1/tables/{tableId}/rows
update_row dangerous PUT /api/1/rows/{rowId}
delete_row dangerous DELETE /api/1/rows/{rowId}

Column types

create_column accepts a column_type parameter with type-specific optional parameters:

Type Subtypes Key Parameters
text line, long, rich, link text_default, text_max_length
number (none), stars, progress number_default, number_min, number_max, number_decimals, number_prefix, number_suffix
selection (none), check, multi selection_options (JSON), selection_default
datetime (none), date, time datetime_default
usergroup (none)

Row data format

create_row and update_row accept a data parameter as a JSON string mapping column IDs to values:

{"5": "Alice", "6": 95}

This matches the Tables API v1 contract where the backend converts {columnId: value} pairs internally.

Test Plan

  • Tested all 12 endpoints against Nextcloud 32.0.8 + Tables 1.0.5
  • list_tables returns tables with metadata, views, row/column counts
  • create_table with title + emoji returns new table with id
  • create_column with text type (line subtype, mandatory) works
  • create_column with number type (min/max constraints) works
  • create_row with column data mapping creates row correctly
  • list_rows returns rows with id and data array (column-value pairs)
  • update_row partial update (single column) preserves other columns
  • update_column rename + description change works
  • update_table rename works
  • delete_row, delete_column, delete_table all return deleted object
  • Integration test with Context Agent MCP server (requires running ExApp)

Add a new tool module for the Nextcloud Tables app with 12 MCP tools
covering full CRUD operations across tables, columns, and rows:

Tables: list_tables, create_table, update_table, delete_table
Columns: list_columns, create_column, update_column, delete_column
Rows: list_rows, create_row, update_row, delete_row

Column creation supports all five column types (text, number, selection,
datetime, usergroup) with their type-specific configuration parameters.
Row data is passed as a JSON string mapping column IDs to values,
matching the Tables API v1 contract.

Availability check: 'tables' in nc.capabilities.
Tested against Nextcloud 32.0.8 with Tables 1.0.5.

Signed-off-by: Pavlinchen <paulm.schmidt@icloud.com>
@Pavlinchen Pavlinchen force-pushed the feat/tables-support branch from d005177 to 084595d Compare April 22, 2026 04:47
@janepie
Copy link
Copy Markdown
Member

janepie commented Apr 22, 2026

Thank you for all the new tools! I'll take some time to check these. Did you test all of these tools per hand or per AI agent?

@Pavlinchen
Copy link
Copy Markdown
Contributor Author

Hello,
thanks to you for being a maintainer of this project! :)

I had two LLMs with different contexts & prompts verify the functionality.
If requested I'm happy to add some actual tests and or their documentation. If you have anything specific in mind, let me know :)

@janepie
Copy link
Copy Markdown
Member

janepie commented Apr 23, 2026

I'd like you to please run the changes on a local instance and try it out yourself for real, to see if the tools work as expected when actually used :) Developing per LLM is fine, but please check the work manually

@janepie
Copy link
Copy Markdown
Member

janepie commented Apr 27, 2026

@Pavlinchen as soon as you tested this and the other PRs manually, please give me a ping :)

@Pavlinchen
Copy link
Copy Markdown
Contributor Author

Pavlinchen commented Apr 28, 2026

@janepie I have tested the actuall calling of the tools the same way an LLM would locally against a mock instance, but can understand that you would like a full end-to-end test (especially for such a "big" feature).
I am currently on creating the docs for that
--> it is not in my interest to waste your time either ;)

@janepie
Copy link
Copy Markdown
Member

janepie commented May 4, 2026

What do you mean by "creating the docs"?
I'd like you to run a test instance where your branch of Context Agent is installed and type in some questions, no doc-writing needed :) If you need any help with the setup, don't hesitate to ask!

@Pavlinchen
Copy link
Copy Markdown
Contributor Author

Ah, that simplifies things significantly, thanks for the clarification.
I'll make sure to get back to you as soon as I can (things got a bit busy personally right now)

@janepie
Copy link
Copy Markdown
Member

janepie commented May 6, 2026

All good, don't worry :)

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 7, 2026

Hello there,
Thank you so much for taking the time and effort to create a pull request to our Nextcloud project.

We hope that the review process is going smooth and is helpful for you. We want to ensure your pull request is reviewed to your satisfaction. If you have a moment, our community management team would very much appreciate your feedback on your experience with this PR review process.

Your feedback is valuable to us as we continuously strive to improve our community developer experience. Please take a moment to complete our short survey by clicking on the following link: https://cloud.nextcloud.com/apps/forms/s/i9Ago4EQRZ7TWxjfmeEpPkf6

Thank you for contributing to Nextcloud and we hope to hear from you soon!

(If you believe you should not receive this message, you can add yourself to the blocklist.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants