Skip to content

I gotta have more tools#127

Merged
marcelklehr merged 31 commits intomainfrom
feat/moartools
Mar 25, 2026
Merged

I gotta have more tools#127
marcelklehr merged 31 commits intomainfrom
feat/moartools

Conversation

@marcelklehr
Copy link
Copy Markdown
Member

@marcelklehr marcelklehr commented Mar 11, 2026

@janepie maybe we can share reviewing and testing these together?

Reviewed and tested works:

  • bookmarks
  • tasks: Works
  • circles: Works, although deleting members and circles doesn't seem to work for me on stable33
  • cookbook: Mostly works. Updating recipes doesn't work, though
  • deck
  • files
  • forms
  • mail: broken, list_mail_folders uses a nonexistent route and everything else depends on that
  • music
  • news
  • notes
  • passwords
  • polls
  • sharing

Signed-off-by: Marcel Klehr <mklehr@gmx.net>
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR significantly expands the available “all_tools” integrations by adding new tool modules for multiple Nextcloud apps (e.g., Shares, Polls, Photos, Passwords, Notes, News, Music, Forms, Bookmarks, Circles, Cookbook) and extending existing tool sets (Files, Deck, Calendar, Mail).

Changes:

  • Add many new tool modules exposing Nextcloud app APIs via @tool functions (safe/dangerous).
  • Extend existing tools for Files (WebDAV ops + tags), Deck (card operations), Calendar (task operations), and Mail (folder/message helpers).
  • Introduce new per-app availability gating via is_available for most new modules.

Reviewed changes

Copilot reviewed 15 out of 15 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
ex_app/lib/all_tools/shares.py New sharing + groups tools (list/create/update/delete shares, group info)
ex_app/lib/all_tools/polls.py New Polls tools (list, details, create/options/votes, close/reopen)
ex_app/lib/all_tools/photos.py New Photos tools (albums CRUD, album membership changes, date search)
ex_app/lib/all_tools/passwords.py New Passwords tools (folders, search/list, CRUD incl. secret retrieval)
ex_app/lib/all_tools/notes.py New Notes tools (list/get/create/update/delete + client-side search)
ex_app/lib/all_tools/news.py New News/RSS tools (feeds/folders/items + mark read/unread)
ex_app/lib/all_tools/music.py New Music tools (library browsing/search + playlist CRUD)
ex_app/lib/all_tools/forms.py New Forms tools (list/details/create/questions/responses/settings)
ex_app/lib/all_tools/bookmarks.py New Bookmarks tools (list/search + bookmark/folder/tag management)
ex_app/lib/all_tools/circles.py New Circles/Teams tools (CRUD circles + membership + share to circle)
ex_app/lib/all_tools/cookbook.py New Cookbook tools (recipes CRUD + categories + search)
ex_app/lib/all_tools/files.py Adds WebDAV file ops + file tagging tools
ex_app/lib/all_tools/deck.py Expands Deck tooling for card lifecycle, labels, assignments, comments
ex_app/lib/all_tools/calendar.py Adds task list/complete/update/delete tools (CalDAV todos)
ex_app/lib/all_tools/mail.py Adds folder listing, message listing/search, move/delete helpers

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

marcelklehr and others added 2 commits March 11, 2026 14:47
Copilot AI and others added 8 commits March 17, 2026 22:07
- deck.py: Fix list_boards() returning response.text instead of response.json()
- mail.py: Fix wrong docstring on get_mail_account_list(), rewrite
  list_mail_folders, search_emails, get_email_messages, move_email_to_folder,
  delete_email to use correct Nextcloud Mail REST API routes instead of
  nonexistent OCS routes
- polls.py: Fix all routes to include correct /api/v1.0/ prefix, fix
  create_poll payload (API doesn't accept description), fix add_poll_option
  payload structure, fix vote_on_poll to use correct URL-based answer format
- forms.py: Update from nonexistent v2.4 API to correct v3 API, fix
  create_form to use two-step create+update pattern, fix add_question_to_form
  payload, fix option creation to use batch optionTexts parameter
- files.py: Fix get_folder_tree to use params= instead of json= for GET request

Co-authored-by: marcelklehr <986878+marcelklehr@users.noreply.github.com>
Nextcloud's SecurityMiddleware enforces CSRF checks on controller methods
without @NoCSRFRequired. ExApps don't have CSRF tokens, but Nextcloud's
Request::passesCSRFCheck() bypasses CSRF if the OCS-APIREQUEST header is
present (any non-empty value).

The nc_py_api library sets this header on the main OCS adapter, but NOT
on fresh adapters created via _create_adapter(True) used for REST calls.

Added "OCS-APIREQUEST": "true" header to all non-DAV REST API calls in:
bookmarks, cookbook, deck, mail, music, news, passwords, photos.

DAV calls (files.py, contacts.py, calendar.py) use /remote.php/dav/ which
goes through Sabre auth (AppAPIAuthBackend), not the CSRF middleware.

OCS calls (forms.py, polls.py, notes.py, circles.py, shares.py) already
have CSRF bypass via the OCS adapter's built-in OCS-APIREQUEST header.

Co-authored-by: marcelklehr <986878+marcelklehr@users.noreply.github.com>
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
Signed-off-by: Marcel Klehr <mklehr@gmx.net>

# Conflicts:
#	ex_app/lib/all_tools/bookmarks.py
#	ex_app/lib/all_tools/circles.py
#	ex_app/lib/all_tools/cookbook.py
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
@marcelklehr
Copy link
Copy Markdown
Member Author

@janepie I dropped all changes that didn't work and or I didn't have the motivation to test, everything in here should now work

Signed-off-by: Marcel Klehr <mklehr@gmx.net>
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
@marcelklehr marcelklehr requested a review from julien-nc March 24, 2026 10:47
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
@julien-nc
Copy link
Copy Markdown
Member

  • Deck add card
  • Deck assign card (impossible to target an existing card by name, it only works right after a card has been added so the agent knows its ID, there could be a "list board cards" tool with an optional list ID param)
  • Delete card

Wdyt about the "list board cards" tool?

I occasionally got something like messages with role 'tool' must be a response to a preceeding message with 'tool_calls' (with OpenAI + GPT 4.1) or No tool call found for function call output with call_id call_1t4CeDkPZAlWVXMBiNdGbj4d (with OpenRouter + GPT 4.1). It's easy to reproduce but i don't have a clear procedure.

Last time it happened, I just did:

  • list the cards in all lists of the NAME board
  • assign card 8 to the admin user
  • delete card 7

And the "chat with tools" task failed because the request response was messages with role 'tool' must be a response to a preceeding message...

@marcelklehr
Copy link
Copy Markdown
Member Author

I occasionally got something like messages with role 'tool' must be a response to a preceeding message with 'tool_calls'

Can you check if this happens with the main branch as well?

@julien-nc
Copy link
Copy Markdown
Member

Same with main, it seems i'm consistently getting this error after a fixed number of tool calls. I had the same session multiple times:

  • list my talk conversations
  • what is the weather in Paris?
  • list my deck boards
  • what is the weather in Berlin?

And I always got the error for the last message.

@julien-nc
Copy link
Copy Markdown
Member

julien-nc commented Mar 25, 2026

Tools in files.py ✔️

I could see the new tools after registering the app again.

Sharing ✔️

@marcelklehr
Copy link
Copy Markdown
Member Author

Deck assign card (impossible to target an existing card by name, it only works right after a card has been added so the agent knows its ID, there could be a "list board cards" tool with an optional list ID param)

Works for me, it can use the search tool

@julien-nc
Copy link
Copy Markdown
Member

Works for me, it can use the search tool

Now I have the tools. All good.

@marcelklehr marcelklehr merged commit bc27b12 into main Mar 25, 2026
6 checks passed
@marcelklehr marcelklehr deleted the feat/moartools branch March 25, 2026 13:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants