Feat: Add ALLOWED_TOOLS filter and fix forum mark_as_read#82
Open
nhomar wants to merge 1 commit intochigwell:mainfrom
Open
Feat: Add ALLOWED_TOOLS filter and fix forum mark_as_read#82nhomar wants to merge 1 commit intochigwell:mainfrom
nhomar wants to merge 1 commit intochigwell:mainfrom
Conversation
- Implemented an `ALLOWED_TOOLS` environment variable to filter the number of tools registered with FastMCP. This is crucial to prevent token limits and context overflows in downstream AI clients (e.g. Antigravity) that cannot handle 100+ tools. - Improved `mark_as_read` by adding support for forum topics properly utilizing `GetForumTopicsRequest` and `ReadDiscussionRequest`.
eb7d7e4 to
28f4adf
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR introduces two major fixes:
ALLOWED_TOOLSFiltering (Antigravity Context Optimization)Implemented an
ALLOWED_TOOLSenvironment variable that dynamically filters the number of tools registered with FastMCP. This is crucial for downstream AI clients like Antigravity, which suffer from context overflows when 100+ generic or unused tools are loaded simultaneously into the LLM context.mark_as_readForum Topic SupportThe original
mark_as_readimplementation only cleared the general chat history usingsend_read_acknowledge(entity). It did not clear unread badges for forums (supergroups with topics enabled).GetForumTopicsRequest.unread_count > 0orunread_mentions_count > 0).ReadDiscussionRequestdirectly against the specific topicmsg_idto reliably clear the notification badge for that individual thread.