Update README, docstrings, and test scope for temporary_addressbook
This commit is contained in:
@@ -16,6 +16,7 @@ The server provides integration with multiple Nextcloud apps, enabling LLMs to i
|
|||||||
| **Calendar** | ✅ Full Support | Complete calendar integration - create, update, delete events. Support for recurring events, reminders, attendees, and all-day events via CalDAV. |
|
| **Calendar** | ✅ Full Support | Complete calendar integration - create, update, delete events. Support for recurring events, reminders, attendees, and all-day events via CalDAV. |
|
||||||
| **Tables** | ⚠️ Row Operations | Read table schemas and perform CRUD operations on table rows. Table management not yet supported. |
|
| **Tables** | ⚠️ Row Operations | Read table schemas and perform CRUD operations on table rows. Table management not yet supported. |
|
||||||
| **Files (WebDAV)** | ✅ Full Support | Complete file system access - browse directories, read/write files, create/delete resources. |
|
| **Files (WebDAV)** | ✅ Full Support | Complete file system access - browse directories, read/write files, create/delete resources. |
|
||||||
|
| **Contacts** | ✅ Full Support | Create, read, update, and delete contacts and address books via CardDAV. |
|
||||||
|
|
||||||
## Available Tools
|
## Available Tools
|
||||||
|
|
||||||
@@ -46,6 +47,17 @@ The server provides integration with multiple Nextcloud apps, enabling LLMs to i
|
|||||||
| `nc_calendar_bulk_operations` | **New:** Bulk update, delete, or move events matching filter criteria |
|
| `nc_calendar_bulk_operations` | **New:** Bulk update, delete, or move events matching filter criteria |
|
||||||
| `nc_calendar_manage_calendar` | **New:** Create, delete, and manage calendar properties |
|
| `nc_calendar_manage_calendar` | **New:** Create, delete, and manage calendar properties |
|
||||||
|
|
||||||
|
### Contacts Tools
|
||||||
|
|
||||||
|
| Tool | Description |
|
||||||
|
|------|-------------|
|
||||||
|
| `nc_contacts_list_addressbooks` | List all available addressbooks for the user |
|
||||||
|
| `nc_contacts_list_contacts` | List all contacts in a specific addressbook |
|
||||||
|
| `nc_contacts_create_addressbook` | Create a new addressbook |
|
||||||
|
| `nc_contacts_delete_addressbook` | Delete an addressbook |
|
||||||
|
| `nc_contacts_create_contact` | Create a new contact in an addressbook |
|
||||||
|
| `nc_contacts_delete_contact` | Delete a contact from an addressbook |
|
||||||
|
|
||||||
### Tables Tools
|
### Tables Tools
|
||||||
|
|
||||||
| Tool | Description |
|
| Tool | Description |
|
||||||
|
|||||||
@@ -25,7 +25,12 @@ def configure_contacts_tools(mcp: FastMCP):
|
|||||||
async def nc_contacts_create_addressbook(
|
async def nc_contacts_create_addressbook(
|
||||||
ctx: Context, *, name: str, display_name: str
|
ctx: Context, *, name: str, display_name: str
|
||||||
):
|
):
|
||||||
"""Create a new addressbook."""
|
"""Create a new addressbook.
|
||||||
|
|
||||||
|
Args:
|
||||||
|
name: The name of the addressbook.
|
||||||
|
display_name: The display name of the addressbook.
|
||||||
|
"""
|
||||||
client: NextcloudClient = ctx.request_context.lifespan_context.client
|
client: NextcloudClient = ctx.request_context.lifespan_context.client
|
||||||
return await client.contacts.create_addressbook(
|
return await client.contacts.create_addressbook(
|
||||||
name=name, display_name=display_name
|
name=name, display_name=display_name
|
||||||
@@ -41,7 +46,13 @@ def configure_contacts_tools(mcp: FastMCP):
|
|||||||
async def nc_contacts_create_contact(
|
async def nc_contacts_create_contact(
|
||||||
ctx: Context, *, addressbook: str, uid: str, contact_data: dict
|
ctx: Context, *, addressbook: str, uid: str, contact_data: dict
|
||||||
):
|
):
|
||||||
"""Create a new contact."""
|
"""Create a new contact.
|
||||||
|
|
||||||
|
Args:
|
||||||
|
addressbook: The name of the addressbook to create the contact in.
|
||||||
|
uid: The unique ID for the contact.
|
||||||
|
contact_data: A dictionary with the contact's details, e.g. {"fn": "John Doe", "email": "john.doe@example.com"}.
|
||||||
|
"""
|
||||||
client: NextcloudClient = ctx.request_context.lifespan_context.client
|
client: NextcloudClient = ctx.request_context.lifespan_context.client
|
||||||
return await client.contacts.create_contact(
|
return await client.contacts.create_contact(
|
||||||
addressbook=addressbook, uid=uid, contact_data=contact_data
|
addressbook=addressbook, uid=uid, contact_data=contact_data
|
||||||
|
|||||||
+1
-1
@@ -172,7 +172,7 @@ async def temporary_note_with_attachment(
|
|||||||
# which should also trigger the WebDAV directory deletion attempt.
|
# which should also trigger the WebDAV directory deletion attempt.
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture
|
@pytest.fixture(scope="module")
|
||||||
async def temporary_addressbook(nc_client: NextcloudClient):
|
async def temporary_addressbook(nc_client: NextcloudClient):
|
||||||
"""
|
"""
|
||||||
Fixture to create a temporary addressbook for a test and ensure its deletion afterward.
|
Fixture to create a temporary addressbook for a test and ensure its deletion afterward.
|
||||||
|
|||||||
Reference in New Issue
Block a user