istavrak commented on code in PR #107: URL: https://github.com/apache/flink-agents/pull/107#discussion_r2286870305
########## python/flink_agents/api/tools/mcp.py: ########## @@ -0,0 +1,131 @@ +################################################################################ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +################################################################################# +from __future__ import annotations + +from abc import ABC +from typing import Any, Dict, List, Optional, Tuple + +from pydantic import Field +from typing_extensions import override + +from flink_agents.api.resource import Resource, ResourceType +from flink_agents.api.tools.tool import BaseTool, ToolMetadata, ToolType +from flink_agents.api.prompts.prompt import Prompt + + +class MCPToolDefinition(BaseTool, ABC): + """MCP tool definition that can be called directly. + + This represents a single tool from an MCP server. + """ + + @classmethod + @override + def tool_type(cls) -> ToolType: + return ToolType.MCP + + @classmethod + @override + def call(self, *args: Any, **kwargs: Any) -> Any: + """Call the MCP tool with the given arguments.""" + raise NotImplementedError + + +class MCPPrompt(Prompt): + """MCP prompt definition that extends the base Prompt class. + + This represents a prompt template from an MCP server. + """ + + name: str + description: Optional[str] = None + arguments: Dict[str, Any] = Field(default_factory=dict) Review Comment: Thanks! The template here refers to the prompt template. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@flink.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org