Skip to content

Change mcp to call_tool before adding get_resource#9

Merged
eyalzh merged 3 commits intomainfrom
mcp-resource-support
Aug 14, 2025
Merged

Change mcp to call_tool before adding get_resource#9
eyalzh merged 3 commits intomainfrom
mcp-resource-support

Conversation

@eyalzh
Copy link
Owner

@eyalzh eyalzh commented Aug 12, 2025

No description provided.

@eyalzh eyalzh requested a review from Copilot August 12, 2025 14:02

This comment was marked as outdated.

@eyalzh eyalzh requested a review from Copilot August 14, 2025 10:48
Copy link

Copilot AI left a 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 refactors the MCP template system by renaming the mcp() function to call_tool() and introduces a new get_resource() function for MCP resource access. The changes improve the API clarity by providing distinct functions for different MCP operations.

Key changes:

  • Renamed mcp() function to call_tool() across all templates and documentation
  • Added new get_resource() function for accessing MCP resources
  • Created comprehensive test coverage for the new resource functionality

Reviewed Changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
engine/globals.py Added create_mcp_resource_function and imported AnyUrl for resource handling
engine/init.py Updated global function registration from mcp to call_tool and added get_resource
tests/templates/spec*.md Renamed function calls from mcp() to call_tool() and added resource examples
tests/e2e/test_e2e.py Added comprehensive test for MCP resource functionality
README.md Updated documentation examples to use new function names
CLAUDE.md Updated project documentation to reflect API changes
tests/README.md Added usage examples for new resource functionality

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

logging.error(f"Error fetching resource {resource_uri}: {e}")
return {}
pass

Copy link

Copilot AI Aug 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The pass statement at the end of the function is unnecessary and should be removed as it serves no purpose after the return statement.

Suggested change

Copilot uses AI. Check for mistakes.
@eyalzh eyalzh merged commit 43a098a into main Aug 14, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant