We Built a Machine for Getting AnswersTry the MotherDuck MCP

Skip to main content

list_shares

List all database shares that have been shared with you.

Description

The list_shares tool returns all database shares that have been shared with you by other users. Each share includes its name and URL, which can be used to attach the share as a database using the query tool.

To attach a share, execute: ATTACH '<share_url>' AS my_alias;

To detach a share: DETACH <database_alias>;

Input Parameters

This tool takes no input parameters.

Output Schema

{
"success": boolean,
"shares": [ // List of shares (on success)
{
"name": string, // Share name
"url": string // Share URL for attaching
}
],
"error": string // Error message (on failure)
}

Example Usage

List available shares:

What shares have been shared with me?

The AI assistant will call the tool with no parameters.

Attach a share after listing:

Attach the sales_data share so I can query it

After getting the share URL from list_shares, the AI will use the query tool:

{
"database": "my_db",
"sql": "ATTACH 'md:_share/org123/sales_data' AS sales_data"
}

Success Response Example

{
"success": true,
"shares": [
{
"name": "sales_data",
"url": "md:_share/org123/sales_data"
},
{
"name": "product_catalog",
"url": "md:_share/org456/product_catalog"
},
{
"name": "analytics_benchmark",
"url": "md:_share/org789/analytics_benchmark"
}
]
}

Empty Response Example

When no shares have been shared with you:

{
"success": true,
"shares": []
}