Skip to content

Commit 5a73877

Browse files
committed
Release 1.3.1
1 parent 7c39a24 commit 5a73877

File tree

9 files changed

+327
-21
lines changed

9 files changed

+327
-21
lines changed

poetry.lock

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name = "klavis"
33

44
[tool.poetry]
55
name = "klavis"
6-
version = "1.2.1"
6+
version = "1.3.1"
77
description = ""
88
readme = "README.md"
99
authors = []

reference.md

Lines changed: 77 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ client.mcp_server.create_server_instance(
241241
<dl>
242242
<dd>
243243

244-
**server_name:** `McpServerName` — The name of the target MCP server.
244+
**server_name:** `McpServerName` — The name of the target MCP server. Case-insensitive (e.g., 'google calendar', 'GOOGLE_CALENDAR', 'Google Calendar' are all valid).
245245

246246
</dd>
247247
</dl>
@@ -548,7 +548,7 @@ client.mcp_server.get_tools(
548548
<dl>
549549
<dd>
550550

551-
**server_name:** `McpServerName` — The name of the target MCP server.
551+
**server_name:** `McpServerName` — The name of the target MCP server. Case-insensitive (e.g., 'google calendar', 'GOOGLE_CALENDAR', 'Google Calendar' are all valid).
552552

553553
</dd>
554554
</dl>
@@ -704,6 +704,80 @@ client.mcp_server.set_instance_auth_token(
704704
</dl>
705705

706706

707+
</dd>
708+
</dl>
709+
</details>
710+
711+
<details><summary><code>client.mcp_server.<a href="src/klavis/mcp_server/client.py">get_instance_auth_metadata</a>(...)</code></summary>
712+
<dl>
713+
<dd>
714+
715+
#### 📝 Description
716+
717+
<dl>
718+
<dd>
719+
720+
<dl>
721+
<dd>
722+
723+
Retrieves the auth metadata for a specific instance that the API key owner controls.
724+
Includes access token, refresh token, and other authentication metadata.
725+
726+
This endpoint includes proper ownership verification to ensure users can only access
727+
authentication data for instances they own. It also handles token refresh if needed.
728+
</dd>
729+
</dl>
730+
</dd>
731+
</dl>
732+
733+
#### 🔌 Usage
734+
735+
<dl>
736+
<dd>
737+
738+
<dl>
739+
<dd>
740+
741+
```python
742+
from klavis import Klavis
743+
744+
client = Klavis(
745+
api_key="YOUR_API_KEY",
746+
)
747+
client.mcp_server.get_instance_auth_metadata(
748+
instance_id="instance_id",
749+
)
750+
751+
```
752+
</dd>
753+
</dl>
754+
</dd>
755+
</dl>
756+
757+
#### ⚙️ Parameters
758+
759+
<dl>
760+
<dd>
761+
762+
<dl>
763+
<dd>
764+
765+
**instance_id:** `str` — The ID of the connection instance to get auth metadata for.
766+
767+
</dd>
768+
</dl>
769+
770+
<dl>
771+
<dd>
772+
773+
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
774+
775+
</dd>
776+
</dl>
777+
</dd>
778+
</dl>
779+
780+
707781
</dd>
708782
</dl>
709783
</details>
@@ -760,7 +834,7 @@ client.mcp_server.get_o_auth_url(
760834
<dl>
761835
<dd>
762836

763-
**server_name:** `McpServerName` — The name of the target MCP server.
837+
**server_name:** `McpServerName` — The name of the target MCP server. Case-insensitive (e.g., 'google calendar', 'GOOGLE_CALENDAR', 'Google Calendar' are all valid).
764838

765839
</dd>
766840
</dl>

src/klavis/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
GDriveOAuthSuccessResponse,
2929
GSheetsOAuthErrorResponse,
3030
GSheetsOAuthSuccessResponse,
31+
GetAuthMetadataResponse,
3132
GetInstanceResponse,
3233
GetMcpServersResponse,
3334
GetOAuthUrlResponse,
@@ -122,6 +123,7 @@
122123
"GDriveOAuthSuccessResponse",
123124
"GSheetsOAuthErrorResponse",
124125
"GSheetsOAuthSuccessResponse",
126+
"GetAuthMetadataResponse",
125127
"GetInstanceResponse",
126128
"GetMcpServersResponse",
127129
"GetOAuthUrlResponse",

src/klavis/core/client_wrapper.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@ def __init__(
2020

2121
def get_headers(self) -> typing.Dict[str, str]:
2222
headers: typing.Dict[str, str] = {
23-
"User-Agent": "klavis/1.2.1",
23+
"User-Agent": "klavis/1.3.1",
2424
"X-Fern-Language": "Python",
2525
"X-Fern-SDK-Name": "klavis",
26-
"X-Fern-SDK-Version": "1.2.1",
26+
"X-Fern-SDK-Version": "1.3.1",
2727
}
2828
api_key = self._get_api_key()
2929
if api_key is not None:

src/klavis/mcp_server/client.py

Lines changed: 89 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
from ..types.call_tool_response import CallToolResponse
88
from ..types.connection_type import ConnectionType
99
from ..types.create_server_response import CreateServerResponse
10+
from ..types.get_auth_metadata_response import GetAuthMetadataResponse
1011
from ..types.get_instance_response import GetInstanceResponse
1112
from ..types.get_mcp_servers_response import GetMcpServersResponse
1213
from ..types.get_o_auth_url_response import GetOAuthUrlResponse
@@ -160,7 +161,7 @@ def create_server_instance(
160161
Parameters
161162
----------
162163
server_name : McpServerName
163-
The name of the target MCP server.
164+
The name of the target MCP server. Case-insensitive (e.g., 'google calendar', 'GOOGLE_CALENDAR', 'Google Calendar' are all valid).
164165
165166
user_id : str
166167
The identifier for the user requesting the server URL.
@@ -312,7 +313,7 @@ def get_tools(
312313
Parameters
313314
----------
314315
server_name : McpServerName
315-
The name of the target MCP server.
316+
The name of the target MCP server. Case-insensitive (e.g., 'google calendar', 'GOOGLE_CALENDAR', 'Google Calendar' are all valid).
316317
317318
request_options : typing.Optional[RequestOptions]
318319
Request-specific configuration.
@@ -402,6 +403,43 @@ def set_instance_auth_token(
402403
)
403404
return _response.data
404405

406+
def get_instance_auth_metadata(
407+
self, instance_id: str, *, request_options: typing.Optional[RequestOptions] = None
408+
) -> GetAuthMetadataResponse:
409+
"""
410+
Retrieves the auth metadata for a specific instance that the API key owner controls.
411+
Includes access token, refresh token, and other authentication metadata.
412+
413+
This endpoint includes proper ownership verification to ensure users can only access
414+
authentication data for instances they own. It also handles token refresh if needed.
415+
416+
Parameters
417+
----------
418+
instance_id : str
419+
The ID of the connection instance to get auth metadata for.
420+
421+
request_options : typing.Optional[RequestOptions]
422+
Request-specific configuration.
423+
424+
Returns
425+
-------
426+
GetAuthMetadataResponse
427+
Successful Response
428+
429+
Examples
430+
--------
431+
from klavis import Klavis
432+
433+
client = Klavis(
434+
api_key="YOUR_API_KEY",
435+
)
436+
client.mcp_server.get_instance_auth_metadata(
437+
instance_id="instance_id",
438+
)
439+
"""
440+
_response = self._raw_client.get_instance_auth_metadata(instance_id, request_options=request_options)
441+
return _response.data
442+
405443
def get_o_auth_url(
406444
self,
407445
*,
@@ -419,7 +457,7 @@ def get_o_auth_url(
419457
Parameters
420458
----------
421459
server_name : McpServerName
422-
The name of the target MCP server.
460+
The name of the target MCP server. Case-insensitive (e.g., 'google calendar', 'GOOGLE_CALENDAR', 'Google Calendar' are all valid).
423461
424462
instance_id : str
425463
The unique identifier for the connection instance.
@@ -619,7 +657,7 @@ async def create_server_instance(
619657
Parameters
620658
----------
621659
server_name : McpServerName
622-
The name of the target MCP server.
660+
The name of the target MCP server. Case-insensitive (e.g., 'google calendar', 'GOOGLE_CALENDAR', 'Google Calendar' are all valid).
623661
624662
user_id : str
625663
The identifier for the user requesting the server URL.
@@ -803,7 +841,7 @@ async def get_tools(
803841
Parameters
804842
----------
805843
server_name : McpServerName
806-
The name of the target MCP server.
844+
The name of the target MCP server. Case-insensitive (e.g., 'google calendar', 'GOOGLE_CALENDAR', 'Google Calendar' are all valid).
807845
808846
request_options : typing.Optional[RequestOptions]
809847
Request-specific configuration.
@@ -919,6 +957,51 @@ async def main() -> None:
919957
)
920958
return _response.data
921959

960+
async def get_instance_auth_metadata(
961+
self, instance_id: str, *, request_options: typing.Optional[RequestOptions] = None
962+
) -> GetAuthMetadataResponse:
963+
"""
964+
Retrieves the auth metadata for a specific instance that the API key owner controls.
965+
Includes access token, refresh token, and other authentication metadata.
966+
967+
This endpoint includes proper ownership verification to ensure users can only access
968+
authentication data for instances they own. It also handles token refresh if needed.
969+
970+
Parameters
971+
----------
972+
instance_id : str
973+
The ID of the connection instance to get auth metadata for.
974+
975+
request_options : typing.Optional[RequestOptions]
976+
Request-specific configuration.
977+
978+
Returns
979+
-------
980+
GetAuthMetadataResponse
981+
Successful Response
982+
983+
Examples
984+
--------
985+
import asyncio
986+
987+
from klavis import AsyncKlavis
988+
989+
client = AsyncKlavis(
990+
api_key="YOUR_API_KEY",
991+
)
992+
993+
994+
async def main() -> None:
995+
await client.mcp_server.get_instance_auth_metadata(
996+
instance_id="instance_id",
997+
)
998+
999+
1000+
asyncio.run(main())
1001+
"""
1002+
_response = await self._raw_client.get_instance_auth_metadata(instance_id, request_options=request_options)
1003+
return _response.data
1004+
9221005
async def get_o_auth_url(
9231006
self,
9241007
*,
@@ -936,7 +1019,7 @@ async def get_o_auth_url(
9361019
Parameters
9371020
----------
9381021
server_name : McpServerName
939-
The name of the target MCP server.
1022+
The name of the target MCP server. Case-insensitive (e.g., 'google calendar', 'GOOGLE_CALENDAR', 'Google Calendar' are all valid).
9401023
9411024
instance_id : str
9421025
The unique identifier for the connection instance.

0 commit comments

Comments
 (0)