Skip to content

Add read_media_file tool and rename read_file#1

Merged
cliffhall merged 4 commits intomainfrom
codex/rename-read_file-to-read_text_file-and-add-read_media_file
Jul 18, 2025
Merged

Add read_media_file tool and rename read_file#1
cliffhall merged 4 commits intomainfrom
codex/rename-read_file-to-read_text_file-and-add-read_media_file

Conversation

@cliffhall
Copy link
Copy Markdown
Owner

Summary

  • rename read_file to read_text_file
  • add read_media_file tool which returns images or audio as base64 data
  • document new tools in filesystem README

Testing

  • npm test --workspaces --if-present

https://chatgpt.com/codex/tasks/task_e_687a7a2a9bc88331a89c05d3e5566b23

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Summary of Changes

Hello @cliffhall, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request enhances the file system interaction capabilities by clearly separating the handling of text and media files. It renames an existing text-reading tool for improved clarity and introduces a dedicated tool for processing binary media, ensuring appropriate data representation for different file types.

Highlights

  • Tool Renaming: The existing read_file tool has been renamed to read_text_file to explicitly indicate its purpose of reading text-based file content. This also clarifies that it treats files as UTF-8 text regardless of extension.
  • New Media File Tool: A new tool, read_media_file, has been introduced. This tool is designed to handle binary media files (specifically images and audio), returning their content as base64 encoded data along with their detected MIME type.
  • Documentation Updates: The src/filesystem/README.md has been updated to reflect the read_file rename, detailing its head and tail parameters, and to document the newly added read_media_file tool, including its input and output specifications.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in issue comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist is currently in preview and may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments to provide feedback.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request refactors the file reading functionality by renaming read_file to read_text_file and introducing a new read_media_file tool for handling binary files like images and audio. I've suggested moving a constant object out of the request handler for better performance and maintainability, and removing an as any type assertion to improve type safety. I also have a minor suggestion for the README to improve documentation consistency.

cliffhall and others added 3 commits July 18, 2025 14:18
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
@cliffhall
Copy link
Copy Markdown
Owner Author

@gemini-code-assist summary

@gemini-code-assist
Copy link
Copy Markdown

Summary of Changes

This pull request enhances the file system interaction capabilities by clarifying the purpose of the existing text file reading tool through a rename, and by introducing a dedicated tool for handling binary media files. This allows the system to process and return image and audio data in a base64 format, significantly expanding the types of files that can be directly accessed and utilized.

Highlights

  • Tool Renaming: The existing read_file tool has been renamed to read_text_file to more accurately reflect its function of reading text-based file content.
  • New Media Handling Tool: A new tool, read_media_file, has been introduced. This tool is designed to read image and audio files and return their content as base64 encoded data, along with the appropriate MIME type.
  • Dependency Update: The @modelcontextprotocol/sdk dependency has been updated to version 1.16.0, which also brings in a new transitive dependency, eventsource-parser.
  • Documentation Updates: The filesystem README has been updated to document the renamed read_text_file tool and provide details for the newly added read_media_file tool.
Changelog
  • package-lock.json
    • Updated @modelcontextprotocol/sdk from 1.12.3 to 1.16.0.
    • Added eventsource-parser as a new transitive dependency.
  • src/filesystem/README.md
    • Renamed documentation for read_file to read_text_file.
    • Updated description for read_text_file to specify text-only reading and mention head/tail parameters.
    • Added new documentation for the read_media_file tool, detailing its purpose and input parameters.
  • src/filesystem/index.ts
    • Imported createReadStream for streaming file content (line 13).
    • Renamed ReadFileArgsSchema to ReadTextFileArgsSchema (line 120).
    • Added ReadMediaFileArgsSchema for the new media tool (line 126).
    • Introduced readFileAsBase64Stream utility function to efficiently read and base64 encode file content (lines 482-495).
    • Updated the ListToolsRequestSchema handler to rename read_file to read_text_file and include the new read_media_file tool definition (lines 502-519).
    • Modified the CallToolRequestSchema handler to process read_text_file calls under its new name and added a new case for read_media_file to handle media file reading, MIME type detection, and base64 encoding (lines 631-694).
  • src/filesystem/package.json
    • Updated @modelcontextprotocol/sdk from 1.12.3 to 1.16.0.
Activity
  • The author, cliffhall, requested a summary of the pull request.
  • gemini-code-assist[bot] provided a medium-priority review comment suggesting consistent Inputs: formatting for tool documentation in src/filesystem/README.md (comment ID: 2216591039).
  • gemini-code-assist[bot] provided a medium-priority review comment recommending moving the mimeTypes object to a module-level constant in src/filesystem/index.ts for better efficiency and organization (comment ID: 2216591090).
  • gemini-code-assist[bot] provided a medium-priority review comment advising to improve type safety by using a more specific literal union type instead of as any for the type variable in the read_media_file handler in src/filesystem/index.ts (comment ID: 2216591099).

@cliffhall cliffhall merged commit d8c8044 into main Jul 18, 2025
18 checks passed
cliffhall pushed a commit that referenced this pull request Oct 10, 2025
cliffhall pushed a commit that referenced this pull request Oct 18, 2025
* Add NCP - Production-ready MCP orchestrator with 94.8% token reduction

NCP transforms MCP tool management from O(n) to O(1) complexity through intelligent on-demand discovery. Instead of loading all tool schemas upfront (11,000+ tokens), NCP provides unified interfaces that discover and execute capabilities as needed.

Key features:
- 94.8% token reduction (measured across 12,847+ conversations)
- 98.2% discovery accuracy with 47ms latency
- O(1) complexity scaling for unlimited tools
- Production validation with 99.97% uptime
- Academic research backing (arXiv publication)

Perfect for users with multiple MCPs who want faster, more efficient AI performance.

* Update NCP tagline and messaging

- Correct tagline: '1 MCP to rule them all'
- Emphasize cognitive overload reduction and environmental impact
- Focus on energy efficiency and carbon footprint reduction
- Remove 'production ready' language that suggests newcomer status

* Add NCP - The #1 MCP to Rule Them All

- Production-ready orchestrator with 94.8% token reduction
- Intelligent on-demand tool discovery with O(1) complexity
- Manages 50+ MCPs with 47ms discovery latency
- Enterprise features and comprehensive production validation
- 12,847 conversations tested across 2,797 tools

* Remove duplicate NCP entry and update description

Removed duplicate entry for NCP and updated its description.

* Update README.md

---------

Co-authored-by: Arul Kumaran <arul@portel.dev>
Co-authored-by: adam jones <domdomegg+git@gmail.com>
cliffhall pushed a commit that referenced this pull request Nov 18, 2025
fix(sequential-thinking): Keep case of json params and description same
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