Skip to content

Commit 1dfdad5

Browse files
author
Chris Coutinho
committed
Update README, docstrings, and test scope for temporary_addressbook
1 parent 72cb62a commit 1dfdad5

File tree

3 files changed

+26
-3
lines changed

3 files changed

+26
-3
lines changed

README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ The server provides integration with multiple Nextcloud apps, enabling LLMs to i
1616
| **Calendar** | ✅ Full Support | Complete calendar integration - create, update, delete events. Support for recurring events, reminders, attendees, and all-day events via CalDAV. |
1717
| **Tables** | ⚠️ Row Operations | Read table schemas and perform CRUD operations on table rows. Table management not yet supported. |
1818
| **Files (WebDAV)** | ✅ Full Support | Complete file system access - browse directories, read/write files, create/delete resources. |
19+
| **Contacts** | ✅ Full Support | Create, read, update, and delete contacts and address books via CardDAV. |
1920

2021
## Available Tools
2122

@@ -46,6 +47,17 @@ The server provides integration with multiple Nextcloud apps, enabling LLMs to i
4647
| `nc_calendar_bulk_operations` | **New:** Bulk update, delete, or move events matching filter criteria |
4748
| `nc_calendar_manage_calendar` | **New:** Create, delete, and manage calendar properties |
4849

50+
### Contacts Tools
51+
52+
| Tool | Description |
53+
|------|-------------|
54+
| `nc_contacts_list_addressbooks` | List all available addressbooks for the user |
55+
| `nc_contacts_list_contacts` | List all contacts in a specific addressbook |
56+
| `nc_contacts_create_addressbook` | Create a new addressbook |
57+
| `nc_contacts_delete_addressbook` | Delete an addressbook |
58+
| `nc_contacts_create_contact` | Create a new contact in an addressbook |
59+
| `nc_contacts_delete_contact` | Delete a contact from an addressbook |
60+
4961
### Tables Tools
5062

5163
| Tool | Description |

nextcloud_mcp_server/server/contacts.py

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,12 @@ async def nc_contacts_list_contacts(ctx: Context, *, addressbook: str):
2525
async def nc_contacts_create_addressbook(
2626
ctx: Context, *, name: str, display_name: str
2727
):
28-
"""Create a new addressbook."""
28+
"""Create a new addressbook.
29+
30+
Args:
31+
name: The name of the addressbook.
32+
display_name: The display name of the addressbook.
33+
"""
2934
client: NextcloudClient = ctx.request_context.lifespan_context.client
3035
return await client.contacts.create_addressbook(
3136
name=name, display_name=display_name
@@ -41,7 +46,13 @@ async def nc_contacts_delete_addressbook(ctx: Context, *, name: str):
4146
async def nc_contacts_create_contact(
4247
ctx: Context, *, addressbook: str, uid: str, contact_data: dict
4348
):
44-
"""Create a new contact."""
49+
"""Create a new contact.
50+
51+
Args:
52+
addressbook: The name of the addressbook to create the contact in.
53+
uid: The unique ID for the contact.
54+
contact_data: A dictionary with the contact's details, e.g. {"fn": "John Doe", "email": "[email protected]"}.
55+
"""
4556
client: NextcloudClient = ctx.request_context.lifespan_context.client
4657
return await client.contacts.create_contact(
4758
addressbook=addressbook, uid=uid, contact_data=contact_data

tests/conftest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ async def temporary_note_with_attachment(
172172
# which should also trigger the WebDAV directory deletion attempt.
173173

174174

175-
@pytest.fixture
175+
@pytest.fixture(scope="module")
176176
async def temporary_addressbook(nc_client: NextcloudClient):
177177
"""
178178
Fixture to create a temporary addressbook for a test and ensure its deletion afterward.

0 commit comments

Comments
 (0)