get_recent_executions
Retrieve recent tool executions from FCCS MCP Agentic Server for rating and review purposes. Filter by tool name or limit results to analyze performance.
Instructions
Get recent tool executions that can be rated / Obter execucoes recentes que podem ser avaliadas
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| tool_name | No | Optional filter by specific tool name | |
| limit | No | Maximum number of executions to return (default: 10) |
Implementation Reference
- fccs_agent/tools/feedback.py:62-99 (handler)MCP tool handler: async function that calls feedback_service.get_recent_executions and formats the response.async def get_recent_executions( tool_name: Optional[str] = None, limit: int = 10 ) -> dict[str, Any]: """Get recent tool executions that can be rated. Use this to find execution IDs for tools you want to provide feedback on. Args: tool_name: Optional filter by specific tool name limit: Maximum number of executions to return (default: 10) Returns: dict: List of recent executions with their IDs and status """ feedback_service = get_feedback_service() if not feedback_service: return { "status": "error", "error": "Feedback service not available" } try: executions = feedback_service.get_recent_executions( tool_name=tool_name, limit=limit ) return { "status": "success", "executions": executions, "count": len(executions) } except Exception as e: return { "status": "error", "error": f"Failed to get executions: {str(e)}" }
- fccs_agent/tools/feedback.py:129-146 (schema)Input schema definition for the 'get_recent_executions' tool in TOOL_DEFINITIONS."name": "get_recent_executions", "description": "Get recent tool executions that can be rated / Obter execucoes recentes que podem ser avaliadas", "inputSchema": { "type": "object", "properties": { "tool_name": { "type": "string", "description": "Optional filter by specific tool name", }, "limit": { "type": "integer", "description": "Maximum number of executions to return (default: 10)", "default": 10, }, }, }, }, ]
- fccs_agent/agent.py:138-185 (registration)Tool registration in TOOL_HANDLERS dictionary mapping name to handler function.TOOL_HANDLERS = { # Application "get_application_info": application.get_application_info, "get_rest_api_version": application.get_rest_api_version, # Jobs "list_jobs": jobs.list_jobs, "get_job_status": jobs.get_job_status, "run_business_rule": jobs.run_business_rule, "run_data_rule": jobs.run_data_rule, # Dimensions "get_dimensions": dimensions.get_dimensions, "get_members": dimensions.get_members, "get_dimension_hierarchy": dimensions.get_dimension_hierarchy, # Journals "get_journals": journals.get_journals, "get_journal_details": journals.get_journal_details, "perform_journal_action": journals.perform_journal_action, "update_journal_period": journals.update_journal_period, "export_journals": journals.export_journals, "import_journals": journals.import_journals, # Data "export_data_slice": data.export_data_slice, "smart_retrieve": data.smart_retrieve, "smart_retrieve_consolidation_breakdown": data.smart_retrieve_consolidation_breakdown, "smart_retrieve_with_movement": data.smart_retrieve_with_movement, "copy_data": data.copy_data, "clear_data": data.clear_data, # Reports "generate_report": reports.generate_report, "get_report_job_status": reports.get_report_job_status, "generate_report_script": reports.generate_report_script, # Consolidation "export_consolidation_rulesets": consolidation.export_consolidation_rulesets, "import_consolidation_rulesets": consolidation.import_consolidation_rulesets, "validate_metadata": consolidation.validate_metadata, "generate_intercompany_matching_report": consolidation.generate_intercompany_matching_report, "import_supplementation_data": consolidation.import_supplementation_data, "deploy_form_template": consolidation.deploy_form_template, "generate_consolidation_process_report": consolidation.generate_consolidation_process_report, # Memo "generate_system_pitch": memo.generate_system_pitch, "generate_investment_memo": memo.generate_investment_memo, # Feedback "submit_feedback": feedback.submit_feedback, "get_recent_executions": feedback.get_recent_executions, # Local Data "query_local_metadata": local_data.query_local_metadata, }
- Core service method that queries the database for recent tool executions using SQLAlchemy.def get_recent_executions( self, tool_name: Optional[str] = None, limit: int = 50 ) -> list[dict]: """Get recent tool executions.""" with self.Session() as session: query = session.query(ToolExecution).order_by( ToolExecution.created_at.desc() ) if tool_name: query = query.filter(ToolExecution.tool_name == tool_name) query = query.limit(limit) return [ { "id": e.id, "session_id": e.session_id, "tool_name": e.tool_name, "success": e.success, "execution_time_ms": e.execution_time_ms, "user_rating": e.user_rating, "created_at": e.created_at.isoformat() if e.created_at else None } for e in query.all() ]