-
Notifications
You must be signed in to change notification settings - Fork 14
feat: Add storage events integration #130
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Matovidlo
commented
Jun 2, 2025
- Extend RawClient API to contain storage event.
- Create mcp_context for tools execution, fill tool name and arguments of tools that were executed.
- Extend tests to check send storage events.
e6cf0f6
to
d04ad21
Compare
3024518
to
3b0f99a
Compare
763ba04
to
fb0e11a
Compare
@vita-stejskal https://keboola.atlassian.net/browse/AI-1192 this is not done in this PR I am unsure whether we need that. I think we are able to construct whole session from start to end (Except logginging in). I think that's I think part of Data dog as currently our events are binded with Storage API and are not for general use |
ccb9e89
to
22579de
Compare
- Extend RawClient API to contain storage event. - Create mcp_context for tools execution, fill tool name and arguments of tools that were executed. - Extend tests to check send storage events.
Update client to send new schema related updates
Reason: it will be executed through annotation
Add arguments from result into storage event trigger
22579de
to
066ffdd
Compare
498ec8a
to
111f370
Compare
111f370
to
ce0c750
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR integrates storage event logging by extending the RawKeboolaClient
with a new trigger_event
method and associated TriggerEventRequest
model, enhances the tool_errors
decorator to gather execution context and send events on errors, and updates unit and integration tests to verify event behavior and suppression.
- Introduce
trigger_event
inRawKeboolaClient
and theTriggerEventRequest
Pydantic model - Extend
tool_errors
decorator to extract session/tool context and dispatch storage events on failures - Update tests to cover successful and error event payloads and ensure no events are sent on regular HTTP calls
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.
Show a summary per file
File | Description |
---|---|
tests/test_client_events.py | Add tests for trigger_event payloads and suppression on HTTP calls |
src/keboola_mcp_server/tools/components/tools.py | Switch to UTC‐aware timestamps with datetime.now(timezone.utc) |
src/keboola_mcp_server/errors.py | Implement context extraction helpers and enhance tool_errors decorator |
src/keboola_mcp_server/client.py | Add trigger_event method and TriggerEventRequest model |
integtests/test_errors.py | Add integration tests to verify event dispatch in tool_errors |
integtests/conftest.py | Introduce unique_id fixture for test resource IDs |
Comments suppressed due to low confidence (3)
tests/test_client_events.py:125
- Consider explicitly mocking
trigger_event
on the client and assertingmock_trigger_event.assert_not_called()
to ensure no events are sent during regular HTTP calls.
# No event should be triggered by HTTP methods anymore
src/keboola_mcp_server/client.py:267
- The
trigger_event
method referencesos.environ
butos
is not imported in this file. Addimport os
at the top to avoid aNameError
.
'appEnv': os.environ.get('APP_ENV', 'development'),
src/keboola_mcp_server/errors.py:218
- The
TriggerEventRequest
model expectsconfiguration_id
(or aliasconfigurationId
), but here you're passingconfig_id
. Rename this keyword toconfiguration_id
to match the model field.
config_id=event_ctx.additional_context.get('config_id'),