Skip to content

Commit 887f4d5

Browse files
authored
Fix MCP by updating whoami endpoint (#120)
1 parent 5c5ece0 commit 887f4d5

File tree

12 files changed

+526
-35
lines changed

12 files changed

+526
-35
lines changed

everyrow-mcp/pyproject.toml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ description = "MCP server for everyrow: agent ops at spreadsheet scale"
55
readme = "README.md"
66
requires-python = ">=3.12"
77
dependencies = [
8-
"everyrow>=0.1.5",
8+
"everyrow>=0.2.1",
99
"mcp[cli]>=1.0.0",
1010
"pandas>=2.0.0",
1111
"pydantic>=2.0.0,<3.0.0",
@@ -29,6 +29,9 @@ dev = [
2929
"ruff>=0.9.9",
3030
]
3131

32+
[tool.uv.sources]
33+
everyrow = { path = "../", editable = true }
34+
3235
[tool.basedpyright]
3336
venvPath = "."
3437
venv = ".venv"

everyrow-mcp/uv.lock

Lines changed: 30 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
"""Contains endpoint functions for accessing the API"""
Lines changed: 135 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,135 @@
1+
from http import HTTPStatus
2+
from typing import Any
3+
4+
import httpx
5+
6+
from ... import errors
7+
from ...client import AuthenticatedClient, Client
8+
from ...models.whoami_whoami_get_response_whoami_whoami_get import WhoamiWhoamiGetResponseWhoamiWhoamiGet
9+
from ...types import Response
10+
11+
12+
def _get_kwargs() -> dict[str, Any]:
13+
_kwargs: dict[str, Any] = {
14+
"method": "get",
15+
"url": "/whoami",
16+
}
17+
18+
return _kwargs
19+
20+
21+
def _parse_response(
22+
*, client: AuthenticatedClient | Client, response: httpx.Response
23+
) -> WhoamiWhoamiGetResponseWhoamiWhoamiGet | None:
24+
if response.status_code == 200:
25+
response_200 = WhoamiWhoamiGetResponseWhoamiWhoamiGet.from_dict(response.json())
26+
27+
return response_200
28+
29+
if client.raise_on_unexpected_status:
30+
raise errors.UnexpectedStatus(response.status_code, response.content)
31+
else:
32+
return None
33+
34+
35+
def _build_response(
36+
*, client: AuthenticatedClient | Client, response: httpx.Response
37+
) -> Response[WhoamiWhoamiGetResponseWhoamiWhoamiGet]:
38+
return Response(
39+
status_code=HTTPStatus(response.status_code),
40+
content=response.content,
41+
headers=response.headers,
42+
parsed=_parse_response(client=client, response=response),
43+
)
44+
45+
46+
def sync_detailed(
47+
*,
48+
client: AuthenticatedClient,
49+
) -> Response[WhoamiWhoamiGetResponseWhoamiWhoamiGet]:
50+
"""Whoami
51+
52+
Return the authenticated user's information.
53+
54+
Raises:
55+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
56+
httpx.TimeoutException: If the request takes longer than Client.timeout.
57+
58+
Returns:
59+
Response[WhoamiWhoamiGetResponseWhoamiWhoamiGet]
60+
"""
61+
62+
kwargs = _get_kwargs()
63+
64+
response = client.get_httpx_client().request(
65+
**kwargs,
66+
)
67+
68+
return _build_response(client=client, response=response)
69+
70+
71+
def sync(
72+
*,
73+
client: AuthenticatedClient,
74+
) -> WhoamiWhoamiGetResponseWhoamiWhoamiGet | None:
75+
"""Whoami
76+
77+
Return the authenticated user's information.
78+
79+
Raises:
80+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
81+
httpx.TimeoutException: If the request takes longer than Client.timeout.
82+
83+
Returns:
84+
WhoamiWhoamiGetResponseWhoamiWhoamiGet
85+
"""
86+
87+
return sync_detailed(
88+
client=client,
89+
).parsed
90+
91+
92+
async def asyncio_detailed(
93+
*,
94+
client: AuthenticatedClient,
95+
) -> Response[WhoamiWhoamiGetResponseWhoamiWhoamiGet]:
96+
"""Whoami
97+
98+
Return the authenticated user's information.
99+
100+
Raises:
101+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
102+
httpx.TimeoutException: If the request takes longer than Client.timeout.
103+
104+
Returns:
105+
Response[WhoamiWhoamiGetResponseWhoamiWhoamiGet]
106+
"""
107+
108+
kwargs = _get_kwargs()
109+
110+
response = await client.get_async_httpx_client().request(**kwargs)
111+
112+
return _build_response(client=client, response=response)
113+
114+
115+
async def asyncio(
116+
*,
117+
client: AuthenticatedClient,
118+
) -> WhoamiWhoamiGetResponseWhoamiWhoamiGet | None:
119+
"""Whoami
120+
121+
Return the authenticated user's information.
122+
123+
Raises:
124+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
125+
httpx.TimeoutException: If the request takes longer than Client.timeout.
126+
127+
Returns:
128+
WhoamiWhoamiGetResponseWhoamiWhoamiGet
129+
"""
130+
131+
return (
132+
await asyncio_detailed(
133+
client=client,
134+
)
135+
).parsed

src/everyrow/generated/models/__init__.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,7 @@
33
from .agent_map_operation import AgentMapOperation
44
from .agent_map_operation_input_type_1_item import AgentMapOperationInputType1Item
55
from .agent_map_operation_input_type_2 import AgentMapOperationInputType2
6-
from .agent_map_operation_response_schema_type_0 import (
7-
AgentMapOperationResponseSchemaType0,
8-
)
6+
from .agent_map_operation_response_schema_type_0 import AgentMapOperationResponseSchemaType0
97
from .billing_response import BillingResponse
108
from .create_artifact_request import CreateArtifactRequest
119
from .create_artifact_request_data_type_0_item import CreateArtifactRequestDataType0Item
@@ -21,6 +19,7 @@
2119
from .http_validation_error import HTTPValidationError
2220
from .insufficient_balance_error import InsufficientBalanceError
2321
from .llm_enum_public import LLMEnumPublic
22+
from .merge_breakdown_response import MergeBreakdownResponse
2423
from .merge_operation import MergeOperation
2524
from .merge_operation_left_input_type_1_item import MergeOperationLeftInputType1Item
2625
from .merge_operation_left_input_type_2 import MergeOperationLeftInputType2
@@ -42,15 +41,14 @@
4241
from .single_agent_operation import SingleAgentOperation
4342
from .single_agent_operation_input_type_1_item import SingleAgentOperationInputType1Item
4443
from .single_agent_operation_input_type_2 import SingleAgentOperationInputType2
45-
from .single_agent_operation_response_schema_type_0 import (
46-
SingleAgentOperationResponseSchemaType0,
47-
)
44+
from .single_agent_operation_response_schema_type_0 import SingleAgentOperationResponseSchemaType0
4845
from .task_result_response import TaskResultResponse
4946
from .task_result_response_data_type_0_item import TaskResultResponseDataType0Item
5047
from .task_result_response_data_type_1 import TaskResultResponseDataType1
5148
from .task_status import TaskStatus
5249
from .task_status_response import TaskStatusResponse
5350
from .validation_error import ValidationError
51+
from .whoami_whoami_get_response_whoami_whoami_get import WhoamiWhoamiGetResponseWhoamiWhoamiGet
5452

5553
__all__ = (
5654
"AgentMapOperation",
@@ -72,6 +70,7 @@
7270
"HTTPValidationError",
7371
"InsufficientBalanceError",
7472
"LLMEnumPublic",
73+
"MergeBreakdownResponse",
7574
"MergeOperation",
7675
"MergeOperationLeftInputType1Item",
7776
"MergeOperationLeftInputType2",
@@ -100,4 +99,5 @@
10099
"TaskStatus",
101100
"TaskStatusResponse",
102101
"ValidationError",
102+
"WhoamiWhoamiGetResponseWhoamiWhoamiGet",
103103
)

src/everyrow/generated/models/dedupe_operation.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,9 @@ class DedupeOperation:
2727
list of JSON objects
2828
equivalence_relation (str): Description of what makes two rows equivalent/duplicates
2929
session_id (None | Unset | UUID): Session ID. If not provided, a new session is auto-created for this task.
30-
strategy (DedupeOperationStrategy | Unset): Controls what happens after duplicate clusters are identified.
31-
IDENTIFY = cluster only (no selection/combining), SELECT = pick best representative per cluster (default),
32-
COMBINE = synthesize a merged row per cluster from all duplicates. Default: DedupeOperationStrategy.SELECT.
33-
strategy_prompt (None | str | Unset): Optional natural-language instructions guiding how the LLM selects or
34-
combines rows (only used with SELECT and COMBINE strategies). Example: "Prefer the most complete record".
30+
strategy (DedupeOperationStrategy | Unset): Strategy for handling duplicates: 'identify' (cluster only),
31+
'select' (pick best), 'combine' (synthesize combined row) Default: DedupeOperationStrategy.SELECT.
32+
strategy_prompt (None | str | Unset): Optional instructions guiding how selection or combining is performed
3533
"""
3634

3735
input_: DedupeOperationInputType2 | list[DedupeOperationInputType1Item] | UUID

src/everyrow/generated/models/llm_enum_public.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,11 @@ class LLMEnumPublic(str, Enum):
1313
CLAUDE_4_5_SONNET_HIGH = "CLAUDE_4_5_SONNET_HIGH"
1414
CLAUDE_4_5_SONNET_MINIMAL = "CLAUDE_4_5_SONNET_MINIMAL"
1515
CLAUDE_4_5_SONNET_THINKING = "CLAUDE_4_5_SONNET_THINKING"
16+
CLAUDE_4_6_OPUS_HIGH = "CLAUDE_4_6_OPUS_HIGH"
17+
CLAUDE_4_6_OPUS_LOW = "CLAUDE_4_6_OPUS_LOW"
18+
CLAUDE_4_6_OPUS_MAX = "CLAUDE_4_6_OPUS_MAX"
19+
CLAUDE_4_6_OPUS_MEDIUM = "CLAUDE_4_6_OPUS_MEDIUM"
20+
CLAUDE_4_6_OPUS_NT = "CLAUDE_4_6_OPUS_NT"
1621
GEMINI_3_FLASH_HIGH = "GEMINI_3_FLASH_HIGH"
1722
GEMINI_3_FLASH_LOW = "GEMINI_3_FLASH_LOW"
1823
GEMINI_3_FLASH_MEDIUM = "GEMINI_3_FLASH_MEDIUM"

0 commit comments

Comments
 (0)