Skip to content

fix: MCP instruction expression brace syntax#2461

Merged
topher-lo merged 2 commits intomainfrom
codex/fix-mcp-instructions-for-templates
Apr 2, 2026
Merged

fix: MCP instruction expression brace syntax#2461
topher-lo merged 2 commits intomainfrom
codex/fix-mcp-instructions-for-templates

Conversation

@topher-lo
Copy link
Copy Markdown
Contributor

@topher-lo topher-lo commented Apr 2, 2026

Motivation

  • MCP clients expect examples to use ${{ ... }} expression syntax, but the instruction string was an f-string which unescaped doubled braces and caused examples to appear as ${ ... }, so the instructions were misleading.

Description

  • Remove the f prefix from the _MCP_INSTRUCTIONS string in tracecat/mcp/server.py so literal ${{ ... }} placeholders are preserved in the server-provided instructions.

Testing

  • Ran uv run ruff check tracecat/mcp/server.py and it completed successfully.

Codex Task


Summary by cubic

Fix MCP server instructions so ${{ ... }} placeholders render correctly for clients. Also removes a redundant unit test tied to specific instruction text.

  • Bug Fixes
    • Switched _MCP_INSTRUCTIONS to a plain triple-quoted string in tracecat/mcp/server.py to preserve literal ${{ ... }}.
    • Removed redundant MCP instructions test in tests/unit/test_mcp_server.py.

Written for commit 17460cd. Summary will update on new commits.

@topher-lo topher-lo temporarily deployed to internal-registry-ci April 2, 2026 18:04 — with GitHub Actions Inactive
@topher-lo topher-lo temporarily deployed to internal-registry-ci April 2, 2026 18:04 — with GitHub Actions Inactive
@zeropath-ai
Copy link
Copy Markdown

zeropath-ai bot commented Apr 2, 2026

No security or compliance issues detected. Reviewed everything up to 17460cd.

Security Overview
Detected Code Changes
Change Type Relevant files
Refactor ► tests/unit/test_mcp_server.py
    Remove unused test function
► tracecat/mcp/server.py
    Simplify _MCP_INSTRUCTIONS string formatting

Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

No issues found across 1 file

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

@blacksmith-sh
Copy link
Copy Markdown
Contributor

blacksmith-sh bot commented Apr 2, 2026

Found 1 test failure on Blacksmith runners:

Failure

Test View Logs
test_large_collection_regressions/test_scatter_gather_massive_payload_50x2mb_e2e View Logs

Fix in Cursor

@topher-lo topher-lo changed the title Fix MCP instruction expression brace syntax fix: MCP instruction expression brace syntax Apr 2, 2026
@topher-lo topher-lo added the fix Bug fix label Apr 2, 2026
@topher-lo topher-lo temporarily deployed to internal-registry-ci April 2, 2026 19:41 — with GitHub Actions Inactive
@topher-lo topher-lo temporarily deployed to internal-registry-ci April 2, 2026 19:41 — with GitHub Actions Inactive
@topher-lo topher-lo merged commit 3187dc8 into main Apr 2, 2026
16 of 17 checks passed
@topher-lo topher-lo deleted the codex/fix-mcp-instructions-for-templates branch April 2, 2026 19:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant