Skip to content

Split override templates into a light index and a per-template detail tool - #4

Draft
92Infinitus92 wants to merge 1 commit into
feat/pump-protocolfrom
feat/mcp-template-index
Draft

Split override templates into a light index and a per-template detail tool#4
92Infinitus92 wants to merge 1 commit into
feat/pump-protocolfrom
feat/mcp-template-index

Conversation

@92Infinitus92

@92Infinitus92 92Infinitus92 commented Aug 11, 2026

Copy link
Copy Markdown
Collaborator

get_override_templates returned every template in full: properties, PDA layout, the whole constant catalog, and a ~160KB IDL inlined per template. An agent had to load all of that just to see what was available.

This splits it in two:

  • get_override_templates now returns a light index - id, name, description, protocol, account type, tags, and a hasLlmContext flag. No properties, no IDL, no inlined options.
  • get_override_template(templateId) returns one template's full detail, with each constant summarized as {label, description, optionsCount} instead of the raw option list.

The flow is index → pick → detail → search_constant_options for a concrete value → create_scenario, and the guidance text walks the model through that order.

Stacked on #3 (base feat/pump-protocol); I'll retarget to develop once that merges.

Greptile Summary

The PR replaces the heavyweight override-template listing with a lightweight index and adds a per-template detail tool.

  • Adds index entries containing identifying metadata and a hasLlmContext flag.
  • Adds get_override_template for properties, account-address data, summarized constants, and LLM context.
  • Updates the MCP resource, tool guidance, and tests to enforce the index → detail → constant search → scenario flow.

Confidence Score: 5/5

The PR appears safe to merge with no concrete blocking or independently actionable non-blocking defects identified.

The new detail method is automatically registered by the existing MCP tool router, its parameter naming follows established conventions, and the updated index and detail responses preserve the data required by the documented scenario workflow.

Important Files Changed

Filename Overview
crates/mcp/src/surfpool/mod.rs Splits template discovery into lightweight index and detailed lookup paths, updates guidance and the resource response, and adds focused coverage for payload shape and unknown IDs.

Sequence Diagram

sequenceDiagram
    participant Client
    participant MCP as Surfpool MCP
    Client->>MCP: get_override_templates()
    MCP-->>Client: Lightweight template index
    Client->>MCP: get_override_template(templateId)
    MCP-->>Client: Properties, address, context, constant summaries
    opt Resolve constant value
        Client->>MCP: search_constant_options(templateId, query)
        MCP-->>Client: Matching concrete values
    end
    Client->>MCP: create_scenario(scenario)
    MCP-->>Client: Scenario result
Loading

Reviews (1): Last reviewed commit: "Split override templates into a light in..." | Re-trigger Greptile

@92Infinitus92 92Infinitus92 self-assigned this Aug 11, 2026
@92Infinitus92

Copy link
Copy Markdown
Collaborator Author

@greptileai

@92Infinitus92
92Infinitus92 force-pushed the feat/mcp-template-index branch from 7d7e45d to 9ecf2de Compare August 11, 2026 10:11
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