Skip to content

get_file_contents: Add ability to select line(s) ranges #350

@kaovilai

Description

@kaovilai

Describe the feature or problem you’d like to solve

get_file_contents - Get contents of a file or directory

owner: Repository owner (string, required)
repo: Repository name (string, required)
path: File path (string, required)
ref: Git reference (string, optional)
begin: begin line# (number, optional)
end: end line# (number, optional)

requested addition in bold

Proposed solution

See above

Additional context

This may help reduce model context consumed by parsing large files if we only want to request a subset..

Activity

aryasoni98

aryasoni98 commented on Apr 26, 2025

@aryasoni98
Contributor

@kaovilai I came across this issue and would love to contribute could you please assign it to me?

kaovilai

kaovilai commented on Apr 27, 2025

@kaovilai
Author

I'm not a maintainer here so I cannot assign anyone.

Akshata990418

Akshata990418 commented on Jul 30, 2025

@Akshata990418

I have integrated Github MCP to my application chainlit+langchain i m also not able to fetch the file content using get_file_contents tool. could anyone help with this @aryasoni98 @kaovilai

Im facing this error while trying to use get_file_contents tool

TypeError: Type is not msgpack serializable: ToolMessage

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      Participants

      @kaovilai@aryasoni98@D1M1TR10S@Akshata990418

      Issue actions

        get_file_contents: Add ability to select line(s) ranges · Issue #350 · github/github-mcp-server