| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152 |
- """
- -----------------------------------------------------------------------------------------
- INTERSEL - 4 cité d'Hauteville - 75010 PARIS
- RCS PARIS 488 379 660 - NAF 721Z
- File : tools/resource/get_resource.py
- Object : Tool to get resources for the MCP server
- -----------------------------------------------------------------------------------------
- Modifications :
- - 2026/01/16 - Damien Lugagne-Delpon - V1.0.0- Creation
- -----------------------------------------------------------------------------------------
- @copyright : Intersel 2026
- @author : Damien Lugagne-Delpon - damien.lugagne-delpon@livinweb.fr
- @version : 1.0.0 (to be updated to the current_version of the developed software if file is touched)
- -----------------------------------------------------------------------------------------
- """
- from mcp_server.tools.resource import ResourceTool
- def get_resource_tool():
- """Create and return the Get Resource tool."""
- parameters = {
- "id": {
- "type": "string",
- "description": "ID of the resource to retrieve",
- "required": True,
- "default": None
- },
- "mandatoryParents": {
- "type": "integer",
- "description": "An authorized parent for the given id",
- "required": False,
- "default": None
- }
- }
-
- tool = ResourceTool(
- name="Get Resource",
- description="Retrieve a resource by its ID.",
- remarks="",
- parameters=parameters,
- handler=get_resource_tool_handler
- )
-
- return tool
- async def get_resource_tool_handler(resource_id):
- """Handler function to get the resource."""
- pass
|