Skip to content

Conversation

@waleedlatif1
Copy link
Collaborator

Summary

  • updated kalshi and polymarket tools to accurately reflect outputs

Type of Change

  • Bug fix

Testing

Tested manually

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

@vercel
Copy link

vercel bot commented Dec 9, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
docs Ready Ready Preview Comment Dec 9, 2025 11:25pm

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Dec 9, 2025

Greptile Overview

Greptile Summary

Refactored Kalshi and Polymarket tool outputs to return flattened data structures instead of nested metadata wrappers, improving the developer experience and making outputs more predictable.

Key Changes

  • Kalshi tools: Removed metadata and redundant success fields from tool outputs, returning data directly (e.g., {balance, portfolioValue} instead of {output: {data, metadata, success}})
  • Polymarket tools: Applied same flattening pattern, added default limit of 50 to prevent browser crashes from large datasets, and stripped nested events arrays from series objects
  • Block outputs: Updated Kalshi and Polymarket block output schemas to specify which fields each operation returns, replacing generic {success, output} with operation-specific outputs like {markets, events, balance, orderbook}
  • Bonus improvements: Enhanced SendGrid block outputs with more granular fields, simplified Zoom block outputs, and added missing tags output to WordPress block

Confidence Score: 5/5

  • This PR is safe to merge with minimal risk
  • The changes are purely structural refactoring that improves code clarity without altering business logic. All tools maintain the same API contracts and data transformations, just removing wrapper layers. The addition of default limits and event array stripping are defensive improvements that prevent performance issues.
  • No files require special attention

Important Files Changed

File Analysis

Filename Score Overview
apps/sim/blocks/blocks/kalshi.ts 5/5 Updated outputs schema to match individual tool outputs, removing generic success/output wrapper
apps/sim/blocks/blocks/polymarket.ts 5/5 Updated outputs schema to match tool outputs, changed limit placeholder to 'max 50'
apps/sim/tools/kalshi/get_balance.ts 5/5 Removed metadata and success fields, flattened output structure to return balance fields directly
apps/sim/tools/polymarket/get_series.ts 5/5 Stripped nested events arrays from series objects and added default limit of 50 to prevent browser crashes
apps/sim/blocks/blocks/sendgrid.ts 5/5 Expanded outputs schema with more granular fields for contact, list, and template operations
apps/sim/blocks/blocks/zoom.ts 5/5 Simplified outputs to specify which operations return each field, removed redundant specific fields

Sequence Diagram

sequenceDiagram
    participant User
    participant Block
    participant Tool
    participant API
    
    User->>Block: Execute operation (e.g., get_balance)
    Block->>Tool: Call tool with params
    Tool->>API: HTTP Request (Kalshi/Polymarket API)
    API-->>Tool: JSON Response
    
    Note over Tool: Before: Wrapped in metadata<br/>{success, output: {data, metadata, success}}
    Note over Tool: After: Flattened structure<br/>{success, output: {data}}
    
    Tool-->>Block: Transformed response
    
    Note over Block: Before: Generic outputs<br/>{success, output}
    Note over Block: After: Specific outputs<br/>{markets, events, balance, etc.}
    
    Block-->>User: Return specific fields based on operation
Loading

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

43 files reviewed, no comments

Edit Code Review Agent Settings | Greptile

@waleedlatif1 waleedlatif1 merged commit 569598b into staging Dec 9, 2025
9 checks passed
@waleedlatif1 waleedlatif1 deleted the fix/tools branch December 9, 2025 23:35
waleedlatif1 added a commit that referenced this pull request Dec 10, 2025
… docs, mcp, autolayout improvements (#2286)

* fix(mcp): prevent redundant MCP server discovery calls at runtime, use cached tool schema instead (#2273)

* fix(mcp): prevent redundant MCP server discovery calls at runtime, use cached tool schema instead

* added backfill, added loading state for tools in settings > mcp

* fix tool inp

* feat(rate-limiter): token bucket algorithm  (#2270)

* fix(ratelimit): make deployed chat rate limited

* improvement(rate-limiter): use token bucket algo

* update docs

* fix

* fix type

* fix db rate limiter

* address greptile comments

* feat(i18n): update translations (#2275)

Co-authored-by: icecrasher321 <icecrasher321@users.noreply.github.com>

* fix(tools): updated kalshi and polymarket tools to accurately reflect outputs (#2274)

* feat(i18n): update translations (#2276)

Co-authored-by: waleedlatif1 <waleedlatif1@users.noreply.github.com>

* fix(autolayout): align by handle (#2277)

* fix(autolayout): align by handle

* use shared constants everywhere

* cleanup

* fix(copilot): fix custom tools (#2278)

* Fix title custom tool

* Checkpoitn (broken)

* Fix custom tool flash

* Edit workflow returns null fix

* Works

* Fix lint

* fix(ime): prevent form submission during IME composition steps (#2279)

* fix(ui): prevent form submission during IME composition steps

* chore(gitignore): add IntelliJ IDE files to .gitignore

---------

Co-authored-by: Vikhyath Mondreti <vikhyathvikku@gmail.com>
Co-authored-by: Waleed <walif6@gmail.com>
Co-authored-by: waleedlatif1 <waleedlatif1@users.noreply.github.com>

* feat(ui): logs, kb, emcn (#2207)

* feat(kb): emcn alignment; sidebar: popover primary; settings-modal: expand

* feat: EMCN breadcrumb; improvement(KB): UI

* fix: hydration error

* improvement(KB): UI

* feat: emcn modal sizing, KB tags; refactor: deleted old sidebar

* feat(logs): UI

* fix: add documents modal name

* feat: logs, emcn, cursorrules; refactor: logs

* feat: dashboard

* feat: notifications; improvement: logs details

* fixed random rectangle on canvas

* fixed the name of the file to align

* fix build

---------

Co-authored-by: waleed <walif6@gmail.com>

* fix(creds): glitch allowing multiple credentials in an integration (#2282)

* improvement: custom tools modal, logs-details (#2283)

* fix(docs): fix copy page button and header hook (#2284)

* improvement(chat): add the ability to download files from the deployed chat (#2280)

* added teams download and chat download file

* Removed comments

* removed comments

* component structure and download all

* removed comments

* cleanup code

* fix empty files case

* small fix

* fix(container): resize heuristic improvement (#2285)

* estimate block height for resize based on subblocks

* fix hydration error

* make more conservative

---------

Co-authored-by: Vikhyath Mondreti <vikhyathvikku@gmail.com>
Co-authored-by: icecrasher321 <icecrasher321@users.noreply.github.com>
Co-authored-by: waleedlatif1 <waleedlatif1@users.noreply.github.com>
Co-authored-by: Siddharth Ganesan <33737564+Sg312@users.noreply.github.com>
Co-authored-by: mosa <mosaxiv@gmail.com>
Co-authored-by: Emir Karabeg <78010029+emir-karabeg@users.noreply.github.com>
Co-authored-by: Adam Gough <77861281+aadamgough@users.noreply.github.com>
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.

2 participants