* refactored version of MCP routs
* feat: revise MCP routes
* working through new routes spec
* refining
* add necessary patch for config
* mcp servers progress
* small fixes
* updates
* finished
* just stage and publish api
* make update static
---------
Co-authored-by: Ari Webb <ari@letta.com>
Co-authored-by: Ari Webb <arijwebb@gmail.com>
* feat: add tool_used field to run_metrics [LET-5419]
* change to tool name
* use tool ids over names
* add generated files
* chore: update OpenAPI schema to include tools_used field in RunMetrics
* update alembic file
- Add validation for archive_id in archives.py
- Add validation for provider_id in providers.py
- Add validation for sandbox_config_id in sandbox_configs.py
- Add validation for step_id in steps.py
- Add validation for identity_id in identities.py
- Update validators.py to include new primitives and remove mcp_server
- Regenerate OpenAPI schema and SDK
🤖 Generated with Claude Code
Co-authored-by: Claude <noreply@anthropic.com>
* change my PR to match Caren's
* add path parameter validation for agent id first
* remove old import
* remove old agent_id_pattern pattern
* add example and fix max/min calculation to include hyphen
* fix regex string interpolation
* example deprecated in favour of examples
* openapi autogen
* change template test to expect 422
* fix 422 swallow
* expect 422 or 400
* rewrite error codes
* fix hallucinated uuid
* tweaked error message test
* print docker logs on failure
* feat: add pagination to agent folders endpoint
* chore: regenerate API client with pagination parameters
* feat: add pagination parameters to agent folders and sources endpoints
- Add pagination parameters (before, after, limit, order, order_by) to list_agent_folders endpoint
- Add pagination parameters to list_agent_sources endpoint
- Update list_attached_sources_async method to support pagination with cursor-based filtering
- Regenerate API client with new pagination parameters
* feat: add pagination to agent blocks endpoint
* chore: regenerate API client with pagination parameters
* feat: implement pagination logic in list_blocks endpoint
- Fix list_blocks implementation to use pagination parameters that were already in the route signature
- Add in-memory pagination logic for core memory blocks (sorting, cursor filtering, limit)
- Sort blocks by created_at timestamp with proper asc/desc ordering
- Apply cursor-based pagination with before/after filters
- Apply limit to results
- Regenerate API client code to reflect pagination functionality
* fix: correct sorting logic in list_blocks endpoint
- Fix AttributeError where blocks don't have created_at attribute
- Sort blocks by id instead of created_at (core memory blocks don't have timestamps)
- Maintains consistent pagination behavior while fixing runtime error
* feat: implement database-level pagination for list_blocks endpoint
- Replace inefficient in-memory filtering with proper SQLAlchemy query
- Use BlocksAgents join table to filter blocks by agent_id at database level
- Apply pagination filters (before, after, limit) in SQL query for better performance
- Sort by BlockModel.created_at instead of in-memory sorting
- Add necessary imports: select from sqlalchemy, db_registry from letta.server.db
- Verify agent access before querying blocks
* refactor: move database logic from route to agent manager service layer
- Add list_agent_blocks_async method to AgentManager for proper separation of concerns
- Move SQLAlchemy query logic from REST route to service layer
- Keep routes focused on request/response handling
- Remove unnecessary imports from router (select, db_registry)
- Database pagination logic now properly encapsulated in service layer
* feat: add pagination to agent messages endpoint
* chore: regenerate API client with pagination parameters
* fix: remove limit fallback and use order parameter for reverse logic