From 0669d0c31a35d9431c8406b4dca2be44b630a276 Mon Sep 17 00:00:00 2001 From: Naseem AlNaji Date: Thu, 6 Nov 2025 11:14:41 -0500 Subject: [PATCH 1/2] feat: improve context param --- src/mcpcat/modules/constants.py | 2 +- tests/community/test_community_tool_context.py | 7 ++++--- tests/test_tool_context.py | 7 ++++--- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/src/mcpcat/modules/constants.py b/src/mcpcat/modules/constants.py index fdf31cf..928660b 100644 --- a/src/mcpcat/modules/constants.py +++ b/src/mcpcat/modules/constants.py @@ -3,4 +3,4 @@ SESSION_ID_PREFIX = "ses" EVENT_ID_PREFIX = "evt" MCPCAT_API_URL = "https://api.mcpcat.io" # Default API URL for MCPCat events -DEFAULT_CONTEXT_DESCRIPTION = "Describe why you are calling this tool and how it fits into your overall task" +DEFAULT_CONTEXT_DESCRIPTION = "Explain why you are calling this tool and how it fits into the user's overall goal. This parameter is used for analytics and user intent tracking. YOU MUST provide 15-25 words (count carefully). NEVER use first person ('I', 'we', 'you') - maintain third-person perspective. NEVER include sensitive information such as credentials, passwords, or personal data. Example (20 words): \"Searching across the organization's repositories to find all open issues related to performance complaints and latency issues for team prioritization.\"" diff --git a/tests/community/test_community_tool_context.py b/tests/community/test_community_tool_context.py index 0cd360f..8e434bc 100644 --- a/tests/community/test_community_tool_context.py +++ b/tests/community/test_community_tool_context.py @@ -3,6 +3,7 @@ import pytest from mcpcat import MCPCatOptions, track +from mcpcat.modules.constants import DEFAULT_CONTEXT_DESCRIPTION from ..test_utils.community_client import create_community_test_client from ..test_utils.community_todo_server import ( @@ -46,7 +47,7 @@ async def test_context_parameter_injection_enabled(self): assert context_schema["type"] == "string" assert ( context_schema["description"] - == "Describe why you are calling this tool and how it fits into your overall task" + == DEFAULT_CONTEXT_DESCRIPTION ) @pytest.mark.asyncio @@ -276,7 +277,7 @@ def tool_with_context(context: str, data: str): context_schema = tool.inputSchema["properties"]["context"] assert ( context_schema.get("description") - == "Describe why you are calling this tool and how it fits into your overall task" + == DEFAULT_CONTEXT_DESCRIPTION ) # Should still be in required @@ -466,7 +467,7 @@ async def test_default_context_description(self): # Check for default description add_todo_tool = next(t for t in tools_result if t.name == "add_todo") context_schema = add_todo_tool.inputSchema["properties"]["context"] - assert context_schema["description"] == "Describe why you are calling this tool and how it fits into your overall task" + assert context_schema["description"] == DEFAULT_CONTEXT_DESCRIPTION @pytest.mark.asyncio async def test_custom_context_description_with_multiple_tools(self): diff --git a/tests/test_tool_context.py b/tests/test_tool_context.py index a2268fc..15974bd 100644 --- a/tests/test_tool_context.py +++ b/tests/test_tool_context.py @@ -6,6 +6,7 @@ from mcp.types import Tool from mcpcat import MCPCatOptions, track +from mcpcat.modules.constants import DEFAULT_CONTEXT_DESCRIPTION from .test_utils.client import create_test_client from .test_utils.todo_server import create_todo_server @@ -40,7 +41,7 @@ async def test_context_parameter_injection_enabled(self): assert context_schema["type"] == "string" assert ( context_schema["description"] - == "Describe why you are calling this tool and how it fits into your overall task" + == DEFAULT_CONTEXT_DESCRIPTION ) @pytest.mark.asyncio @@ -319,7 +320,7 @@ def tool_with_context(context: str, data: str): desc = context_schema.get("description", "") if ( desc - == "Describe why you are calling this tool and how it fits into your overall task" + == DEFAULT_CONTEXT_DESCRIPTION ): # Our description was added - this means the implementation overwrote it # This happens because the check is at the property level not parameter level @@ -705,7 +706,7 @@ async def test_default_context_description(self): # Check for default description add_todo_tool = next(t for t in tools_result.tools if t.name == "add_todo") context_schema = add_todo_tool.inputSchema["properties"]["context"] - assert context_schema["description"] == "Describe why you are calling this tool and how it fits into your overall task" + assert context_schema["description"] == DEFAULT_CONTEXT_DESCRIPTION @pytest.mark.asyncio async def test_custom_context_description_with_multiple_tools(self): From 400a0d088df867d1ad8e9a478ec57ce076bcdc2b Mon Sep 17 00:00:00 2001 From: Naseem AlNaji Date: Thu, 6 Nov 2025 11:46:58 -0500 Subject: [PATCH 2/2] v0.1.11 --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index f6f60c3..23aad8e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "mcpcat" -version = "0.1.10" +version = "0.1.11" description = "Analytics Tool for MCP Servers - provides insights into MCP tool usage patterns" authors = [ { name = "MCPCat", email = "support@mcpcat.io" },