fix(mcp): drop .value on string episode_type in display code#4
Open
jonesmabea wants to merge 1 commit intosandst1:mainfrom
Open
fix(mcp): drop .value on string episode_type in display code#4jonesmabea wants to merge 1 commit intosandst1:mainfrom
jonesmabea wants to merge 1 commit intosandst1:mainfrom
Conversation
MCP tool parameters arrive as plain strings, not EpisodeType enums. The display code in tool_remember() and tool_update_episode() called .value on ep_type, which crashes with "'str' object has no attribute 'value'" when episode_type is passed to the remember or update_episode MCP tools. Fix: remove .value — the string is already the enum's value (e.g. "fact" == EpisodeType.FACT.value).
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.
Bug
The
rememberandupdate_episodeMCP tools crash whenepisode_typeis passed as a parameter.Error:
'str' object has no attribute 'value'Reproduction: Call
remembervia MCP withepisode_type="fact"(or any valid type).Root Cause
MCP tool parameters always arrive as plain strings (e.g.
"fact"), notEpisodeTypeenums. The display code intool_remember()andtool_update_episode()callsep_type.value, which fails on strings.Fix
Remove
.valuefrom the two display lines. The string is already the enum's value ("fact"==EpisodeType.FACT.value), so output is identical.Before:
lines.append(f" Type: {ep_type.value}")After:
lines.append(f" Type: {ep_type}")Affected Lines
remind/mcp_server.py—tool_remember()display coderemind/mcp_server.py—tool_update_episode()display code