universal-mcp-applications 0.1.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- universal_mcp/applications/ahrefs/README.md +51 -0
- universal_mcp/applications/ahrefs/__init__.py +1 -0
- universal_mcp/applications/ahrefs/app.py +2291 -0
- universal_mcp/applications/airtable/README.md +22 -0
- universal_mcp/applications/airtable/__init__.py +1 -0
- universal_mcp/applications/airtable/app.py +479 -0
- universal_mcp/applications/apollo/README.md +44 -0
- universal_mcp/applications/apollo/__init__.py +1 -0
- universal_mcp/applications/apollo/app.py +1847 -0
- universal_mcp/applications/asana/README.md +199 -0
- universal_mcp/applications/asana/__init__.py +1 -0
- universal_mcp/applications/asana/app.py +9509 -0
- universal_mcp/applications/aws-s3/README.md +0 -0
- universal_mcp/applications/aws-s3/__init__.py +1 -0
- universal_mcp/applications/aws-s3/app.py +552 -0
- universal_mcp/applications/bill/README.md +0 -0
- universal_mcp/applications/bill/__init__.py +1 -0
- universal_mcp/applications/bill/app.py +8705 -0
- universal_mcp/applications/box/README.md +307 -0
- universal_mcp/applications/box/__init__.py +1 -0
- universal_mcp/applications/box/app.py +15987 -0
- universal_mcp/applications/braze/README.md +106 -0
- universal_mcp/applications/braze/__init__.py +1 -0
- universal_mcp/applications/braze/app.py +4754 -0
- universal_mcp/applications/cal-com-v2/README.md +150 -0
- universal_mcp/applications/cal-com-v2/__init__.py +1 -0
- universal_mcp/applications/cal-com-v2/app.py +5541 -0
- universal_mcp/applications/calendly/README.md +53 -0
- universal_mcp/applications/calendly/__init__.py +1 -0
- universal_mcp/applications/calendly/app.py +1436 -0
- universal_mcp/applications/canva/README.md +43 -0
- universal_mcp/applications/canva/__init__.py +1 -0
- universal_mcp/applications/canva/app.py +941 -0
- universal_mcp/applications/clickup/README.md +135 -0
- universal_mcp/applications/clickup/__init__.py +1 -0
- universal_mcp/applications/clickup/app.py +5009 -0
- universal_mcp/applications/coda/README.md +108 -0
- universal_mcp/applications/coda/__init__.py +1 -0
- universal_mcp/applications/coda/app.py +3671 -0
- universal_mcp/applications/confluence/README.md +198 -0
- universal_mcp/applications/confluence/__init__.py +1 -0
- universal_mcp/applications/confluence/app.py +6273 -0
- universal_mcp/applications/contentful/README.md +17 -0
- universal_mcp/applications/contentful/__init__.py +1 -0
- universal_mcp/applications/contentful/app.py +364 -0
- universal_mcp/applications/crustdata/README.md +25 -0
- universal_mcp/applications/crustdata/__init__.py +1 -0
- universal_mcp/applications/crustdata/app.py +586 -0
- universal_mcp/applications/dialpad/README.md +202 -0
- universal_mcp/applications/dialpad/__init__.py +1 -0
- universal_mcp/applications/dialpad/app.py +5949 -0
- universal_mcp/applications/digitalocean/README.md +463 -0
- universal_mcp/applications/digitalocean/__init__.py +1 -0
- universal_mcp/applications/digitalocean/app.py +20835 -0
- universal_mcp/applications/domain-checker/README.md +13 -0
- universal_mcp/applications/domain-checker/__init__.py +1 -0
- universal_mcp/applications/domain-checker/app.py +265 -0
- universal_mcp/applications/e2b/README.md +12 -0
- universal_mcp/applications/e2b/__init__.py +1 -0
- universal_mcp/applications/e2b/app.py +187 -0
- universal_mcp/applications/elevenlabs/README.md +88 -0
- universal_mcp/applications/elevenlabs/__init__.py +1 -0
- universal_mcp/applications/elevenlabs/app.py +3235 -0
- universal_mcp/applications/exa/README.md +15 -0
- universal_mcp/applications/exa/__init__.py +1 -0
- universal_mcp/applications/exa/app.py +221 -0
- universal_mcp/applications/falai/README.md +17 -0
- universal_mcp/applications/falai/__init__.py +1 -0
- universal_mcp/applications/falai/app.py +331 -0
- universal_mcp/applications/figma/README.md +49 -0
- universal_mcp/applications/figma/__init__.py +1 -0
- universal_mcp/applications/figma/app.py +1090 -0
- universal_mcp/applications/firecrawl/README.md +20 -0
- universal_mcp/applications/firecrawl/__init__.py +1 -0
- universal_mcp/applications/firecrawl/app.py +514 -0
- universal_mcp/applications/fireflies/README.md +25 -0
- universal_mcp/applications/fireflies/__init__.py +1 -0
- universal_mcp/applications/fireflies/app.py +506 -0
- universal_mcp/applications/fpl/README.md +23 -0
- universal_mcp/applications/fpl/__init__.py +1 -0
- universal_mcp/applications/fpl/app.py +1327 -0
- universal_mcp/applications/fpl/utils/api.py +142 -0
- universal_mcp/applications/fpl/utils/fixtures.py +629 -0
- universal_mcp/applications/fpl/utils/helper.py +982 -0
- universal_mcp/applications/fpl/utils/league_utils.py +546 -0
- universal_mcp/applications/fpl/utils/position_utils.py +68 -0
- universal_mcp/applications/ghost-content/README.md +25 -0
- universal_mcp/applications/ghost-content/__init__.py +1 -0
- universal_mcp/applications/ghost-content/app.py +654 -0
- universal_mcp/applications/github/README.md +1049 -0
- universal_mcp/applications/github/__init__.py +1 -0
- universal_mcp/applications/github/app.py +50600 -0
- universal_mcp/applications/gong/README.md +63 -0
- universal_mcp/applications/gong/__init__.py +1 -0
- universal_mcp/applications/gong/app.py +2297 -0
- universal_mcp/applications/google-ads/README.md +0 -0
- universal_mcp/applications/google-ads/__init__.py +1 -0
- universal_mcp/applications/google-ads/app.py +23 -0
- universal_mcp/applications/google-calendar/README.md +21 -0
- universal_mcp/applications/google-calendar/__init__.py +1 -0
- universal_mcp/applications/google-calendar/app.py +574 -0
- universal_mcp/applications/google-docs/README.md +25 -0
- universal_mcp/applications/google-docs/__init__.py +1 -0
- universal_mcp/applications/google-docs/app.py +760 -0
- universal_mcp/applications/google-drive/README.md +68 -0
- universal_mcp/applications/google-drive/__init__.py +1 -0
- universal_mcp/applications/google-drive/app.py +4936 -0
- universal_mcp/applications/google-gemini/README.md +25 -0
- universal_mcp/applications/google-gemini/__init__.py +1 -0
- universal_mcp/applications/google-gemini/app.py +663 -0
- universal_mcp/applications/google-mail/README.md +31 -0
- universal_mcp/applications/google-mail/__init__.py +1 -0
- universal_mcp/applications/google-mail/app.py +1354 -0
- universal_mcp/applications/google-searchconsole/README.md +21 -0
- universal_mcp/applications/google-searchconsole/__init__.py +1 -0
- universal_mcp/applications/google-searchconsole/app.py +320 -0
- universal_mcp/applications/google-sheet/README.md +36 -0
- universal_mcp/applications/google-sheet/__init__.py +1 -0
- universal_mcp/applications/google-sheet/app.py +1941 -0
- universal_mcp/applications/hashnode/README.md +20 -0
- universal_mcp/applications/hashnode/__init__.py +1 -0
- universal_mcp/applications/hashnode/app.py +455 -0
- universal_mcp/applications/heygen/README.md +44 -0
- universal_mcp/applications/heygen/__init__.py +1 -0
- universal_mcp/applications/heygen/app.py +961 -0
- universal_mcp/applications/http-tools/README.md +16 -0
- universal_mcp/applications/http-tools/__init__.py +1 -0
- universal_mcp/applications/http-tools/app.py +153 -0
- universal_mcp/applications/hubspot/README.md +239 -0
- universal_mcp/applications/hubspot/__init__.py +1 -0
- universal_mcp/applications/hubspot/app.py +416 -0
- universal_mcp/applications/jira/README.md +600 -0
- universal_mcp/applications/jira/__init__.py +1 -0
- universal_mcp/applications/jira/app.py +28804 -0
- universal_mcp/applications/klaviyo/README.md +313 -0
- universal_mcp/applications/klaviyo/__init__.py +1 -0
- universal_mcp/applications/klaviyo/app.py +11236 -0
- universal_mcp/applications/linkedin/README.md +15 -0
- universal_mcp/applications/linkedin/__init__.py +1 -0
- universal_mcp/applications/linkedin/app.py +243 -0
- universal_mcp/applications/mailchimp/README.md +281 -0
- universal_mcp/applications/mailchimp/__init__.py +1 -0
- universal_mcp/applications/mailchimp/app.py +10937 -0
- universal_mcp/applications/markitdown/README.md +12 -0
- universal_mcp/applications/markitdown/__init__.py +1 -0
- universal_mcp/applications/markitdown/app.py +63 -0
- universal_mcp/applications/miro/README.md +151 -0
- universal_mcp/applications/miro/__init__.py +1 -0
- universal_mcp/applications/miro/app.py +5429 -0
- universal_mcp/applications/ms-teams/README.md +42 -0
- universal_mcp/applications/ms-teams/__init__.py +1 -0
- universal_mcp/applications/ms-teams/app.py +1823 -0
- universal_mcp/applications/neon/README.md +74 -0
- universal_mcp/applications/neon/__init__.py +1 -0
- universal_mcp/applications/neon/app.py +2018 -0
- universal_mcp/applications/notion/README.md +30 -0
- universal_mcp/applications/notion/__init__.py +1 -0
- universal_mcp/applications/notion/app.py +527 -0
- universal_mcp/applications/openai/README.md +22 -0
- universal_mcp/applications/openai/__init__.py +1 -0
- universal_mcp/applications/openai/app.py +759 -0
- universal_mcp/applications/outlook/README.md +20 -0
- universal_mcp/applications/outlook/__init__.py +1 -0
- universal_mcp/applications/outlook/app.py +444 -0
- universal_mcp/applications/perplexity/README.md +12 -0
- universal_mcp/applications/perplexity/__init__.py +1 -0
- universal_mcp/applications/perplexity/app.py +65 -0
- universal_mcp/applications/pipedrive/README.md +284 -0
- universal_mcp/applications/pipedrive/__init__.py +1 -0
- universal_mcp/applications/pipedrive/app.py +12924 -0
- universal_mcp/applications/posthog/README.md +132 -0
- universal_mcp/applications/posthog/__init__.py +1 -0
- universal_mcp/applications/posthog/app.py +7125 -0
- universal_mcp/applications/reddit/README.md +135 -0
- universal_mcp/applications/reddit/__init__.py +1 -0
- universal_mcp/applications/reddit/app.py +4652 -0
- universal_mcp/applications/replicate/README.md +18 -0
- universal_mcp/applications/replicate/__init__.py +1 -0
- universal_mcp/applications/replicate/app.py +495 -0
- universal_mcp/applications/resend/README.md +40 -0
- universal_mcp/applications/resend/__init__.py +1 -0
- universal_mcp/applications/resend/app.py +881 -0
- universal_mcp/applications/retell/README.md +21 -0
- universal_mcp/applications/retell/__init__.py +1 -0
- universal_mcp/applications/retell/app.py +333 -0
- universal_mcp/applications/rocketlane/README.md +70 -0
- universal_mcp/applications/rocketlane/__init__.py +1 -0
- universal_mcp/applications/rocketlane/app.py +4346 -0
- universal_mcp/applications/semanticscholar/README.md +25 -0
- universal_mcp/applications/semanticscholar/__init__.py +1 -0
- universal_mcp/applications/semanticscholar/app.py +482 -0
- universal_mcp/applications/semrush/README.md +44 -0
- universal_mcp/applications/semrush/__init__.py +1 -0
- universal_mcp/applications/semrush/app.py +2081 -0
- universal_mcp/applications/sendgrid/README.md +362 -0
- universal_mcp/applications/sendgrid/__init__.py +1 -0
- universal_mcp/applications/sendgrid/app.py +9752 -0
- universal_mcp/applications/sentry/README.md +186 -0
- universal_mcp/applications/sentry/__init__.py +1 -0
- universal_mcp/applications/sentry/app.py +7471 -0
- universal_mcp/applications/serpapi/README.md +14 -0
- universal_mcp/applications/serpapi/__init__.py +1 -0
- universal_mcp/applications/serpapi/app.py +293 -0
- universal_mcp/applications/sharepoint/README.md +0 -0
- universal_mcp/applications/sharepoint/__init__.py +1 -0
- universal_mcp/applications/sharepoint/app.py +215 -0
- universal_mcp/applications/shopify/README.md +321 -0
- universal_mcp/applications/shopify/__init__.py +1 -0
- universal_mcp/applications/shopify/app.py +15392 -0
- universal_mcp/applications/shortcut/README.md +128 -0
- universal_mcp/applications/shortcut/__init__.py +1 -0
- universal_mcp/applications/shortcut/app.py +4478 -0
- universal_mcp/applications/slack/README.md +0 -0
- universal_mcp/applications/slack/__init__.py +1 -0
- universal_mcp/applications/slack/app.py +570 -0
- universal_mcp/applications/spotify/README.md +91 -0
- universal_mcp/applications/spotify/__init__.py +1 -0
- universal_mcp/applications/spotify/app.py +2526 -0
- universal_mcp/applications/supabase/README.md +87 -0
- universal_mcp/applications/supabase/__init__.py +1 -0
- universal_mcp/applications/supabase/app.py +2970 -0
- universal_mcp/applications/tavily/README.md +12 -0
- universal_mcp/applications/tavily/__init__.py +1 -0
- universal_mcp/applications/tavily/app.py +51 -0
- universal_mcp/applications/trello/README.md +266 -0
- universal_mcp/applications/trello/__init__.py +1 -0
- universal_mcp/applications/trello/app.py +10875 -0
- universal_mcp/applications/twillo/README.md +0 -0
- universal_mcp/applications/twillo/__init__.py +1 -0
- universal_mcp/applications/twillo/app.py +269 -0
- universal_mcp/applications/twitter/README.md +100 -0
- universal_mcp/applications/twitter/__init__.py +1 -0
- universal_mcp/applications/twitter/api_segments/__init__.py +0 -0
- universal_mcp/applications/twitter/api_segments/api_segment_base.py +51 -0
- universal_mcp/applications/twitter/api_segments/compliance_api.py +122 -0
- universal_mcp/applications/twitter/api_segments/dm_conversations_api.py +255 -0
- universal_mcp/applications/twitter/api_segments/dm_events_api.py +140 -0
- universal_mcp/applications/twitter/api_segments/likes_api.py +159 -0
- universal_mcp/applications/twitter/api_segments/lists_api.py +395 -0
- universal_mcp/applications/twitter/api_segments/openapi_json_api.py +34 -0
- universal_mcp/applications/twitter/api_segments/spaces_api.py +309 -0
- universal_mcp/applications/twitter/api_segments/trends_api.py +40 -0
- universal_mcp/applications/twitter/api_segments/tweets_api.py +1403 -0
- universal_mcp/applications/twitter/api_segments/usage_api.py +40 -0
- universal_mcp/applications/twitter/api_segments/users_api.py +1498 -0
- universal_mcp/applications/twitter/app.py +46 -0
- universal_mcp/applications/unipile/README.md +28 -0
- universal_mcp/applications/unipile/__init__.py +1 -0
- universal_mcp/applications/unipile/app.py +829 -0
- universal_mcp/applications/whatsapp/README.md +23 -0
- universal_mcp/applications/whatsapp/__init__.py +1 -0
- universal_mcp/applications/whatsapp/app.py +595 -0
- universal_mcp/applications/whatsapp-business/README.md +34 -0
- universal_mcp/applications/whatsapp-business/__init__.py +1 -0
- universal_mcp/applications/whatsapp-business/app.py +1065 -0
- universal_mcp/applications/wrike/README.md +46 -0
- universal_mcp/applications/wrike/__init__.py +1 -0
- universal_mcp/applications/wrike/app.py +1583 -0
- universal_mcp/applications/youtube/README.md +57 -0
- universal_mcp/applications/youtube/__init__.py +1 -0
- universal_mcp/applications/youtube/app.py +1696 -0
- universal_mcp/applications/zenquotes/README.md +12 -0
- universal_mcp/applications/zenquotes/__init__.py +1 -0
- universal_mcp/applications/zenquotes/app.py +31 -0
- universal_mcp_applications-0.1.1.dist-info/METADATA +172 -0
- universal_mcp_applications-0.1.1.dist-info/RECORD +268 -0
- universal_mcp_applications-0.1.1.dist-info/WHEEL +4 -0
- universal_mcp_applications-0.1.1.dist-info/licenses/LICENSE +21 -0
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# NotionApp MCP Server
|
|
2
|
+
|
|
3
|
+
An MCP Server for the NotionApp API.
|
|
4
|
+
|
|
5
|
+
## 🛠️ Tool List
|
|
6
|
+
|
|
7
|
+
This is automatically generated from OpenAPI schema for the NotionApp API.
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
| Tool | Description |
|
|
11
|
+
|------|-------------|
|
|
12
|
+
| `retrieve_a_user` | Retrieves a user's details from the server using their unique identifier. |
|
|
13
|
+
| `list_all_users` | Retrieves a complete list of users from the API endpoint. |
|
|
14
|
+
| `retrieve_your_token_sbot_user` | Retrieves the current user's authentication token information from the SBOT service. |
|
|
15
|
+
| `retrieve_a_database` | Retrieves detailed information about a specific database using its unique identifier. |
|
|
16
|
+
| `update_a_database` | Updates a database entry with the specified ID using a PATCH request. |
|
|
17
|
+
| `query_a_database` | Executes a database query operation using a specified database ID and optional request parameters |
|
|
18
|
+
| `create_a_database` | Creates a new database on the server by sending a POST request to the database endpoint. |
|
|
19
|
+
| `create_a_page` | Creates a new page by sending a POST request to the API endpoint. |
|
|
20
|
+
| `retrieve_a_page` | Retrieves a specific page's data from a remote server using its unique identifier. |
|
|
21
|
+
| `update_page_properties` | Updates the properties of a page with the specified ID using the provided request body. |
|
|
22
|
+
| `retrieve_a_page_property_item` | Retrieves a specific property item from a Notion page using the page ID and property ID. |
|
|
23
|
+
| `retrieve_block_children` | Retrieves all child blocks for a specified parent block using its ID via the API. |
|
|
24
|
+
| `append_block_children` | Appends child elements to a specified block and returns the updated block data. |
|
|
25
|
+
| `retrieve_a_block` | Retrieves a specific block of data from the API using its unique identifier. |
|
|
26
|
+
| `delete_a_block` | Deletes a specified block by its ID and returns the server response. |
|
|
27
|
+
| `update_a_block` | Updates a specific block resource via a PATCH request to the API endpoint |
|
|
28
|
+
| `search` | Executes a search operation by sending a POST request to the search endpoint and returns the results |
|
|
29
|
+
| `retrieve_comments` | Retrieves comments from a remote server with optional block filtering and pagination support. |
|
|
30
|
+
| `add_comment_to_page` | Adds a comment to a page by making an HTTP POST request to the comments endpoint. |
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
from .app import NotionApp
|
|
@@ -0,0 +1,527 @@
|
|
|
1
|
+
from typing import Any
|
|
2
|
+
|
|
3
|
+
from universal_mcp.applications.application import APIApplication
|
|
4
|
+
from universal_mcp.integrations import Integration
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
class NotionApp(APIApplication):
|
|
8
|
+
def __init__(self, integration: Integration = None, **kwargs) -> None:
|
|
9
|
+
super().__init__(name="notion", integration=integration, **kwargs)
|
|
10
|
+
self.base_url = "https://api.notion.com"
|
|
11
|
+
|
|
12
|
+
def _get_headers(self):
|
|
13
|
+
if not self.integration:
|
|
14
|
+
raise ValueError("Integration not configured for NotionApp")
|
|
15
|
+
credentials = self.integration.get_credentials()
|
|
16
|
+
if "headers" in credentials:
|
|
17
|
+
return credentials["headers"]
|
|
18
|
+
return {
|
|
19
|
+
"Authorization": f"Bearer {credentials['access_token']}",
|
|
20
|
+
"Accept": "application/json",
|
|
21
|
+
"Notion-Version": "2022-06-28",
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
def retrieve_a_user(self, id, request_body=None) -> dict[str, Any]:
|
|
25
|
+
"""
|
|
26
|
+
Retrieves a user's details from the server using their unique identifier.
|
|
27
|
+
|
|
28
|
+
Args:
|
|
29
|
+
id: The unique identifier of the user to retrieve
|
|
30
|
+
request_body: Optional request body data for the request. Defaults to None
|
|
31
|
+
|
|
32
|
+
Returns:
|
|
33
|
+
A dictionary containing user details retrieved from the server response
|
|
34
|
+
|
|
35
|
+
Raises:
|
|
36
|
+
ValueError: Raised when the 'id' parameter is None
|
|
37
|
+
requests.exceptions.HTTPError: Raised when the server returns an unsuccessful status code
|
|
38
|
+
|
|
39
|
+
Tags:
|
|
40
|
+
retrieve, get, user, api, single-record, important
|
|
41
|
+
"""
|
|
42
|
+
if id is None:
|
|
43
|
+
raise ValueError("Missing required parameter 'id'")
|
|
44
|
+
url = f"{self.base_url}/v1/users/{id}"
|
|
45
|
+
query_params = {}
|
|
46
|
+
response = self._get(url, params=query_params)
|
|
47
|
+
response.raise_for_status()
|
|
48
|
+
return response.json()
|
|
49
|
+
|
|
50
|
+
def list_all_users(
|
|
51
|
+
self,
|
|
52
|
+
) -> dict[str, Any]:
|
|
53
|
+
"""
|
|
54
|
+
Retrieves a complete list of users from the API endpoint.
|
|
55
|
+
|
|
56
|
+
Args:
|
|
57
|
+
None: This method does not take any parameters.
|
|
58
|
+
|
|
59
|
+
Returns:
|
|
60
|
+
dict[str, Any]: A dictionary containing user data where keys are strings and values can be of any type, representing user information retrieved from the API.
|
|
61
|
+
|
|
62
|
+
Raises:
|
|
63
|
+
HTTPError: Raised when the API request fails or returns a non-200 status code
|
|
64
|
+
RequestException: Raised when there are network connectivity issues or other request-related problems
|
|
65
|
+
|
|
66
|
+
Tags:
|
|
67
|
+
list, users, api, fetch, management
|
|
68
|
+
"""
|
|
69
|
+
url = f"{self.base_url}/v1/users"
|
|
70
|
+
query_params = {}
|
|
71
|
+
response = self._get(url, params=query_params)
|
|
72
|
+
response.raise_for_status()
|
|
73
|
+
return response.json()
|
|
74
|
+
|
|
75
|
+
def retrieve_your_token_sbot_user(
|
|
76
|
+
self,
|
|
77
|
+
) -> dict[str, Any]:
|
|
78
|
+
"""
|
|
79
|
+
Retrieves the current user's authentication token information from the SBOT service.
|
|
80
|
+
|
|
81
|
+
Returns:
|
|
82
|
+
A dictionary containing the authentication token and related user information from the JSON response.
|
|
83
|
+
|
|
84
|
+
Raises:
|
|
85
|
+
requests.exceptions.HTTPError: When the API request fails or returns a non-200 status code
|
|
86
|
+
requests.exceptions.RequestException: When there are network connectivity issues or other request-related problems
|
|
87
|
+
|
|
88
|
+
Tags:
|
|
89
|
+
retrieve, authentication, token, user, api
|
|
90
|
+
"""
|
|
91
|
+
url = f"{self.base_url}/v1/users/me"
|
|
92
|
+
query_params = {}
|
|
93
|
+
response = self._get(url, params=query_params)
|
|
94
|
+
response.raise_for_status()
|
|
95
|
+
return response.json()
|
|
96
|
+
|
|
97
|
+
def retrieve_a_database(self, id) -> dict[str, Any]:
|
|
98
|
+
"""
|
|
99
|
+
Retrieves detailed information about a specific database using its unique identifier.
|
|
100
|
+
|
|
101
|
+
Args:
|
|
102
|
+
id: Unique identifier for the database to retrieve. Must be a non-null value.
|
|
103
|
+
|
|
104
|
+
Returns:
|
|
105
|
+
A dictionary containing detailed information about the requested database.
|
|
106
|
+
|
|
107
|
+
Raises:
|
|
108
|
+
ValueError: Raised when the 'id' parameter is None
|
|
109
|
+
HTTPError: Raised when the API request fails or returns an error status code
|
|
110
|
+
|
|
111
|
+
Tags:
|
|
112
|
+
retrieve, get, database, api, data-access, important
|
|
113
|
+
"""
|
|
114
|
+
if id is None:
|
|
115
|
+
raise ValueError("Missing required parameter 'id'")
|
|
116
|
+
url = f"{self.base_url}/v1/databases/{id}"
|
|
117
|
+
query_params = {}
|
|
118
|
+
response = self._get(url, params=query_params)
|
|
119
|
+
response.raise_for_status()
|
|
120
|
+
return response.json()
|
|
121
|
+
|
|
122
|
+
def update_a_database(self, id, request_body=None) -> dict[str, Any]:
|
|
123
|
+
"""
|
|
124
|
+
Updates a database entry with the specified ID using a PATCH request.
|
|
125
|
+
|
|
126
|
+
Args:
|
|
127
|
+
id: The unique identifier of the database entry to update.
|
|
128
|
+
request_body: Optional dictionary containing the fields and values to update. Defaults to None.
|
|
129
|
+
|
|
130
|
+
Returns:
|
|
131
|
+
dict[str, Any]: A dictionary containing the server's JSON response after the update operation.
|
|
132
|
+
|
|
133
|
+
Raises:
|
|
134
|
+
ValueError: When the 'id' parameter is None.
|
|
135
|
+
requests.exceptions.HTTPError: When the server returns an unsuccessful status code.
|
|
136
|
+
|
|
137
|
+
Tags:
|
|
138
|
+
update, database, patch, api, management
|
|
139
|
+
"""
|
|
140
|
+
if id is None:
|
|
141
|
+
raise ValueError("Missing required parameter 'id'")
|
|
142
|
+
url = f"{self.base_url}/v1/databases/{id}"
|
|
143
|
+
query_params = {}
|
|
144
|
+
response = self._patch(url, data=request_body, params=query_params)
|
|
145
|
+
response.raise_for_status()
|
|
146
|
+
return response.json()
|
|
147
|
+
|
|
148
|
+
def query_a_database(self, id, request_body=None) -> dict[str, Any]:
|
|
149
|
+
"""
|
|
150
|
+
Executes a database query operation using a specified database ID and optional request parameters
|
|
151
|
+
|
|
152
|
+
Args:
|
|
153
|
+
id: The unique identifier of the database to query
|
|
154
|
+
request_body: Optional JSON-compatible dictionary representing the body of the query request; if None, no additional query data is sent
|
|
155
|
+
|
|
156
|
+
Returns:
|
|
157
|
+
A dictionary containing the response data from the database query as parsed from JSON
|
|
158
|
+
|
|
159
|
+
Raises:
|
|
160
|
+
ValueError: Raised when the required 'id' parameter is None
|
|
161
|
+
HTTPError: Raised when the HTTP request fails or returns an error status code
|
|
162
|
+
|
|
163
|
+
Tags:
|
|
164
|
+
query, database, api, data-retrieval, http
|
|
165
|
+
"""
|
|
166
|
+
if id is None:
|
|
167
|
+
raise ValueError("Missing required parameter 'id'")
|
|
168
|
+
url = f"{self.base_url}/v1/databases/{id}/query"
|
|
169
|
+
query_params = {}
|
|
170
|
+
response = self._post(url, data=request_body, params=query_params)
|
|
171
|
+
response.raise_for_status()
|
|
172
|
+
return response.json()
|
|
173
|
+
|
|
174
|
+
def create_a_database(self, request_body=None) -> dict[str, Any]:
|
|
175
|
+
"""
|
|
176
|
+
Creates a new database on the server by sending a POST request to the database endpoint.
|
|
177
|
+
|
|
178
|
+
Args:
|
|
179
|
+
request_body: Optional dictionary containing configuration parameters for the new database. Defaults to None.
|
|
180
|
+
|
|
181
|
+
Returns:
|
|
182
|
+
A dictionary containing the server's JSON response with details of the created database.
|
|
183
|
+
|
|
184
|
+
Raises:
|
|
185
|
+
HTTPError: Raised when the server returns a non-200 status code indicating database creation failure
|
|
186
|
+
RequestException: Raised when network connectivity issues occur during the API request
|
|
187
|
+
JSONDecodeError: Raised when the server response cannot be parsed as valid JSON
|
|
188
|
+
|
|
189
|
+
Tags:
|
|
190
|
+
create, database, api, management
|
|
191
|
+
"""
|
|
192
|
+
url = f"{self.base_url}/v1/databases/"
|
|
193
|
+
query_params = {}
|
|
194
|
+
response = self._post(url, data=request_body, params=query_params)
|
|
195
|
+
response.raise_for_status()
|
|
196
|
+
return response.json()
|
|
197
|
+
|
|
198
|
+
def create_a_page(self, request_body=None) -> dict[str, Any]:
|
|
199
|
+
"""
|
|
200
|
+
Creates a new page by sending a POST request to the API endpoint.
|
|
201
|
+
|
|
202
|
+
Args:
|
|
203
|
+
request_body: Optional dictionary containing the page data to be sent in the POST request body. Defaults to None.
|
|
204
|
+
|
|
205
|
+
Returns:
|
|
206
|
+
Dictionary containing the JSON response from the server with details of the newly created page.
|
|
207
|
+
|
|
208
|
+
Raises:
|
|
209
|
+
HTTPError: When the server returns a non-200 status code, indicating a failed request
|
|
210
|
+
RequestException: When network-related issues occur during the API request
|
|
211
|
+
|
|
212
|
+
Tags:
|
|
213
|
+
create, page, api, http, post
|
|
214
|
+
"""
|
|
215
|
+
url = f"{self.base_url}/v1/pages/"
|
|
216
|
+
query_params = {}
|
|
217
|
+
response = self._post(url, data=request_body, params=query_params)
|
|
218
|
+
response.raise_for_status()
|
|
219
|
+
return response.json()
|
|
220
|
+
|
|
221
|
+
def retrieve_a_page(self, id) -> dict[str, Any]:
|
|
222
|
+
"""
|
|
223
|
+
Retrieves a specific page's data from a remote server using its unique identifier.
|
|
224
|
+
|
|
225
|
+
Args:
|
|
226
|
+
id: The unique identifier of the page to retrieve
|
|
227
|
+
|
|
228
|
+
Returns:
|
|
229
|
+
A dictionary containing the page data returned from the server's JSON response
|
|
230
|
+
|
|
231
|
+
Raises:
|
|
232
|
+
ValueError: When the 'id' parameter is None
|
|
233
|
+
HTTPError: When the server returns an unsuccessful status code
|
|
234
|
+
|
|
235
|
+
Tags:
|
|
236
|
+
retrieve, fetch, api, http, get, page
|
|
237
|
+
"""
|
|
238
|
+
if id is None:
|
|
239
|
+
raise ValueError("Missing required parameter 'id'")
|
|
240
|
+
url = f"{self.base_url}/v1/pages/{id}"
|
|
241
|
+
query_params = {}
|
|
242
|
+
response = self._get(url, params=query_params)
|
|
243
|
+
response.raise_for_status()
|
|
244
|
+
return response.json()
|
|
245
|
+
|
|
246
|
+
def update_page_properties(self, id, request_body=None) -> dict[str, Any]:
|
|
247
|
+
"""
|
|
248
|
+
Updates the properties of a page with the specified ID using the provided request body.
|
|
249
|
+
|
|
250
|
+
Args:
|
|
251
|
+
id: The unique identifier of the page to update. Must not be None.
|
|
252
|
+
request_body: Optional dictionary containing the properties to be updated. Defaults to None.
|
|
253
|
+
|
|
254
|
+
Returns:
|
|
255
|
+
Dictionary containing the updated page properties as returned by the server.
|
|
256
|
+
|
|
257
|
+
Raises:
|
|
258
|
+
ValueError: When the required 'id' parameter is None
|
|
259
|
+
HTTPError: When the server returns an unsuccessful status code
|
|
260
|
+
RequestException: When there is an error making the HTTP request
|
|
261
|
+
|
|
262
|
+
Tags:
|
|
263
|
+
update, api, page-management, http
|
|
264
|
+
"""
|
|
265
|
+
if id is None:
|
|
266
|
+
raise ValueError("Missing required parameter 'id'")
|
|
267
|
+
url = f"{self.base_url}/v1/pages/{id}"
|
|
268
|
+
query_params = {}
|
|
269
|
+
response = self._patch(url, data=request_body, params=query_params)
|
|
270
|
+
response.raise_for_status()
|
|
271
|
+
return response.json()
|
|
272
|
+
|
|
273
|
+
def retrieve_a_page_property_item(self, page_id, property_id) -> dict[str, Any]:
|
|
274
|
+
"""
|
|
275
|
+
Retrieves a specific property item from a Notion page using the page ID and property ID.
|
|
276
|
+
|
|
277
|
+
Args:
|
|
278
|
+
page_id: The unique identifier of the Notion page from which to retrieve the property
|
|
279
|
+
property_id: The unique identifier of the specific property to retrieve
|
|
280
|
+
|
|
281
|
+
Returns:
|
|
282
|
+
A dictionary containing the property item's details from the API response
|
|
283
|
+
|
|
284
|
+
Raises:
|
|
285
|
+
ValueError: When either page_id or property_id is None
|
|
286
|
+
HTTPError: When the API request fails or returns an error status code
|
|
287
|
+
|
|
288
|
+
Tags:
|
|
289
|
+
retrieve, get, property, page, api, notion, important
|
|
290
|
+
"""
|
|
291
|
+
if page_id is None:
|
|
292
|
+
raise ValueError("Missing required parameter 'page_id'")
|
|
293
|
+
if property_id is None:
|
|
294
|
+
raise ValueError("Missing required parameter 'property_id'")
|
|
295
|
+
url = f"{self.base_url}/v1/pages/{page_id}/properties/{property_id}"
|
|
296
|
+
query_params = {}
|
|
297
|
+
response = self._get(url, params=query_params)
|
|
298
|
+
response.raise_for_status()
|
|
299
|
+
return response.json()
|
|
300
|
+
|
|
301
|
+
def retrieve_block_children(self, id, page_size=None) -> dict[str, Any]:
|
|
302
|
+
"""
|
|
303
|
+
Retrieves all child blocks for a specified parent block using its ID via the API.
|
|
304
|
+
|
|
305
|
+
Args:
|
|
306
|
+
id: The unique identifier of the parent block whose children are to be retrieved
|
|
307
|
+
page_size: Optional integer specifying the maximum number of children to return per page in the response
|
|
308
|
+
|
|
309
|
+
Returns:
|
|
310
|
+
A dictionary containing the API response data with the children blocks information
|
|
311
|
+
|
|
312
|
+
Raises:
|
|
313
|
+
ValueError: When the required 'id' parameter is None
|
|
314
|
+
HTTPError: When the API request fails or returns an error status code
|
|
315
|
+
|
|
316
|
+
Tags:
|
|
317
|
+
retrieve, list, blocks, children, pagination, api-call
|
|
318
|
+
"""
|
|
319
|
+
if id is None:
|
|
320
|
+
raise ValueError("Missing required parameter 'id'")
|
|
321
|
+
url = f"{self.base_url}/v1/blocks/{id}/children"
|
|
322
|
+
query_params = {k: v for k, v in [("page_size", page_size)] if v is not None}
|
|
323
|
+
response = self._get(url, params=query_params)
|
|
324
|
+
response.raise_for_status()
|
|
325
|
+
return response.json()
|
|
326
|
+
|
|
327
|
+
def append_block_children(self, id, request_body=None) -> dict[str, Any]:
|
|
328
|
+
"""
|
|
329
|
+
Appends child elements to a specified block and returns the updated block data.
|
|
330
|
+
|
|
331
|
+
Args:
|
|
332
|
+
id: String identifier of the block to which children will be appended
|
|
333
|
+
request_body: Optional dictionary containing the child elements to be appended (default: None)
|
|
334
|
+
|
|
335
|
+
Returns:
|
|
336
|
+
dict[str, Any]: A dictionary containing the updated block data after appending the children
|
|
337
|
+
|
|
338
|
+
Raises:
|
|
339
|
+
ValueError: When the required 'id' parameter is None
|
|
340
|
+
HTTPError: When the API request fails or returns an error status code
|
|
341
|
+
|
|
342
|
+
Tags:
|
|
343
|
+
append, update, blocks, children, api
|
|
344
|
+
"""
|
|
345
|
+
if id is None:
|
|
346
|
+
raise ValueError("Missing required parameter 'id'")
|
|
347
|
+
url = f"{self.base_url}/v1/blocks/{id}/children"
|
|
348
|
+
query_params = {}
|
|
349
|
+
response = self._patch(url, data=request_body, params=query_params)
|
|
350
|
+
response.raise_for_status()
|
|
351
|
+
return response.json()
|
|
352
|
+
|
|
353
|
+
def retrieve_a_block(self, id) -> dict[str, Any]:
|
|
354
|
+
"""
|
|
355
|
+
Retrieves a specific block of data from the API using its unique identifier.
|
|
356
|
+
|
|
357
|
+
Args:
|
|
358
|
+
id: The unique identifier for the block to be retrieved. Must be a non-None value.
|
|
359
|
+
|
|
360
|
+
Returns:
|
|
361
|
+
A dictionary containing the block data retrieved from the API, parsed from the JSON response.
|
|
362
|
+
|
|
363
|
+
Raises:
|
|
364
|
+
ValueError: When the 'id' parameter is None
|
|
365
|
+
HTTPError: When the API request fails or returns an error status code
|
|
366
|
+
|
|
367
|
+
Tags:
|
|
368
|
+
retrieve, fetch, api, data, block, single
|
|
369
|
+
"""
|
|
370
|
+
if id is None:
|
|
371
|
+
raise ValueError("Missing required parameter 'id'")
|
|
372
|
+
url = f"{self.base_url}/v1/blocks/{id}"
|
|
373
|
+
query_params = {}
|
|
374
|
+
response = self._get(url, params=query_params)
|
|
375
|
+
response.raise_for_status()
|
|
376
|
+
return response.json()
|
|
377
|
+
|
|
378
|
+
def delete_a_block(self, id) -> dict[str, Any]:
|
|
379
|
+
"""
|
|
380
|
+
Deletes a specified block by its ID and returns the server response.
|
|
381
|
+
|
|
382
|
+
Args:
|
|
383
|
+
id: The unique identifier of the block to be deleted. Must not be None.
|
|
384
|
+
|
|
385
|
+
Returns:
|
|
386
|
+
A dictionary containing the server's response data after the deletion operation.
|
|
387
|
+
|
|
388
|
+
Raises:
|
|
389
|
+
ValueError: When the 'id' parameter is None
|
|
390
|
+
HTTPError: When the server returns an unsuccessful status code
|
|
391
|
+
|
|
392
|
+
Tags:
|
|
393
|
+
delete, management, api, http, block-management
|
|
394
|
+
"""
|
|
395
|
+
if id is None:
|
|
396
|
+
raise ValueError("Missing required parameter 'id'")
|
|
397
|
+
url = f"{self.base_url}/v1/blocks/{id}"
|
|
398
|
+
query_params = {}
|
|
399
|
+
response = self._delete(url, params=query_params)
|
|
400
|
+
response.raise_for_status()
|
|
401
|
+
return response.json()
|
|
402
|
+
|
|
403
|
+
def update_a_block(self, id, request_body=None) -> dict[str, Any]:
|
|
404
|
+
"""
|
|
405
|
+
Updates a specific block resource via a PATCH request to the API endpoint
|
|
406
|
+
|
|
407
|
+
Args:
|
|
408
|
+
id: The unique identifier of the block to update
|
|
409
|
+
request_body: Optional dictionary containing the update data for the block. Defaults to None
|
|
410
|
+
|
|
411
|
+
Returns:
|
|
412
|
+
Dictionary containing the server's JSON response with the updated block information
|
|
413
|
+
|
|
414
|
+
Raises:
|
|
415
|
+
ValueError: When the required 'id' parameter is None
|
|
416
|
+
HTTPError: When the server responds with an error status code
|
|
417
|
+
|
|
418
|
+
Tags:
|
|
419
|
+
update, patch, api, block-management
|
|
420
|
+
"""
|
|
421
|
+
if id is None:
|
|
422
|
+
raise ValueError("Missing required parameter 'id'")
|
|
423
|
+
url = f"{self.base_url}/v1/blocks/{id}"
|
|
424
|
+
query_params = {}
|
|
425
|
+
response = self._patch(url, data=request_body, params=query_params)
|
|
426
|
+
response.raise_for_status()
|
|
427
|
+
return response.json()
|
|
428
|
+
|
|
429
|
+
def search(self, request_body=None) -> dict[str, Any]:
|
|
430
|
+
"""
|
|
431
|
+
Executes a search operation by sending a POST request to the search endpoint and returns the results
|
|
432
|
+
|
|
433
|
+
Args:
|
|
434
|
+
request_body: Optional dictionary containing the search parameters and filters to be sent in the request. Defaults to None.
|
|
435
|
+
|
|
436
|
+
Returns:
|
|
437
|
+
A dictionary containing the parsed JSON response from the search operation with search results and metadata
|
|
438
|
+
|
|
439
|
+
Raises:
|
|
440
|
+
HTTPError: Raised when the search request fails or returns a non-200 status code
|
|
441
|
+
JSONDecodeError: Raised when the response cannot be parsed as valid JSON
|
|
442
|
+
|
|
443
|
+
Tags:
|
|
444
|
+
search, http, query, api-request, json, important
|
|
445
|
+
"""
|
|
446
|
+
url = f"{self.base_url}/v1/search"
|
|
447
|
+
query_params = {}
|
|
448
|
+
response = self._post(url, data=request_body, params=query_params)
|
|
449
|
+
response.raise_for_status()
|
|
450
|
+
return response.json()
|
|
451
|
+
|
|
452
|
+
def retrieve_comments(
|
|
453
|
+
self, block_id=None, page_size=None, request_body=None
|
|
454
|
+
) -> dict[str, Any]:
|
|
455
|
+
"""
|
|
456
|
+
Retrieves comments from a remote server with optional block filtering and pagination support.
|
|
457
|
+
|
|
458
|
+
Args:
|
|
459
|
+
block_id: Optional string or ID that specifies which block's comments to retrieve. If None, retrieves all comments.
|
|
460
|
+
page_size: Optional integer specifying the number of comments to return per page. If None, uses server's default pagination.
|
|
461
|
+
request_body: Optional dictionary for future extensibility. Currently unused.
|
|
462
|
+
|
|
463
|
+
Returns:
|
|
464
|
+
Dictionary containing comment data parsed from the server's JSON response.
|
|
465
|
+
|
|
466
|
+
Raises:
|
|
467
|
+
HTTPError: Raised when the server returns a non-200 status code
|
|
468
|
+
RequestException: Raised for network-related errors during the HTTP request
|
|
469
|
+
|
|
470
|
+
Tags:
|
|
471
|
+
retrieve, fetch, comments, api, pagination, http
|
|
472
|
+
"""
|
|
473
|
+
url = f"{self.base_url}/v1/comments"
|
|
474
|
+
query_params = {
|
|
475
|
+
k: v
|
|
476
|
+
for k, v in [("block_id", block_id), ("page_size", page_size)]
|
|
477
|
+
if v is not None
|
|
478
|
+
}
|
|
479
|
+
response = self._get(url, params=query_params)
|
|
480
|
+
response.raise_for_status()
|
|
481
|
+
return response.json()
|
|
482
|
+
|
|
483
|
+
def add_comment_to_page(self, request_body=None) -> dict[str, Any]:
|
|
484
|
+
"""
|
|
485
|
+
Adds a comment to a page by making an HTTP POST request to the comments endpoint.
|
|
486
|
+
|
|
487
|
+
Args:
|
|
488
|
+
request_body: Optional dictionary containing the comment data to be posted. If None, an empty comment will be created. Defaults to None.
|
|
489
|
+
|
|
490
|
+
Returns:
|
|
491
|
+
Dictionary containing the server's JSON response with details of the created comment.
|
|
492
|
+
|
|
493
|
+
Raises:
|
|
494
|
+
HTTPError: Raised when the server returns a non-200 status code, indicating the comment creation failed.
|
|
495
|
+
RequestException: Raised when there are network connectivity issues or other request-related problems.
|
|
496
|
+
|
|
497
|
+
Tags:
|
|
498
|
+
add, create, comment, post, api, content-management
|
|
499
|
+
"""
|
|
500
|
+
url = f"{self.base_url}/v1/comments"
|
|
501
|
+
query_params = {}
|
|
502
|
+
response = self._post(url, data=request_body, params=query_params)
|
|
503
|
+
response.raise_for_status()
|
|
504
|
+
return response.json()
|
|
505
|
+
|
|
506
|
+
def list_tools(self):
|
|
507
|
+
return [
|
|
508
|
+
self.retrieve_a_user,
|
|
509
|
+
self.list_all_users,
|
|
510
|
+
self.retrieve_your_token_sbot_user,
|
|
511
|
+
self.retrieve_a_database,
|
|
512
|
+
self.update_a_database,
|
|
513
|
+
self.query_a_database,
|
|
514
|
+
self.create_a_database,
|
|
515
|
+
self.create_a_page,
|
|
516
|
+
self.retrieve_a_page,
|
|
517
|
+
self.update_page_properties,
|
|
518
|
+
self.retrieve_a_page_property_item,
|
|
519
|
+
self.retrieve_block_children,
|
|
520
|
+
self.append_block_children,
|
|
521
|
+
self.retrieve_a_block,
|
|
522
|
+
self.delete_a_block,
|
|
523
|
+
self.update_a_block,
|
|
524
|
+
self.search,
|
|
525
|
+
self.retrieve_comments,
|
|
526
|
+
self.add_comment_to_page,
|
|
527
|
+
]
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# OpenAI MCP Server
|
|
2
|
+
|
|
3
|
+
An MCP Server for the OpenAI API.
|
|
4
|
+
|
|
5
|
+
## 🛠️ Tool List
|
|
6
|
+
|
|
7
|
+
This is automatically generated from OpenAPI schema for the OpenAI API.
|
|
8
|
+
|
|
9
|
+
| Tool | Description |
|
|
10
|
+
| ------------------------ | ------------------------------------------------------------------------- |
|
|
11
|
+
| `create_chat_completion` | Creates a model response for the given chat conversation. |
|
|
12
|
+
| `upload_file` | Upload a file that can be used across various OpenAI API endpoints. |
|
|
13
|
+
| `list_files` | Lists the files that have been uploaded to your OpenAI account. |
|
|
14
|
+
| `retrieve_file` | Retrieves information about a specific file. |
|
|
15
|
+
| `delete_file` | Deletes a file. |
|
|
16
|
+
| `retrieve_file_content` | Retrieves the content of the specified file. |
|
|
17
|
+
| `generate_image` | Creates an image given a prompt. |
|
|
18
|
+
| `create_image_edit` | Creates an edited or extended image given an original image and a prompt. |
|
|
19
|
+
| `create_image_variation` | Creates a variation of a given image. |
|
|
20
|
+
| `create_transcription` | Transcribes audio into the input language. |
|
|
21
|
+
| `create_translation` | Translates audio into English text. |
|
|
22
|
+
| `create_speech` | Generates audio from the input text. |
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
from .app import OpenaiApp
|