# Get File Contents

> Get the contents of a file or directory from a GitHub repository

- Skill: `xiaobai1017/get-file-contents` (Agent Skill)
- Install (CLI): `npx skillmds@latest add xiaobai1017/get-file-contents`
- Raw SKILL.md: https://api.skillmd.com/api/skills/xiaobai1017/get-file-contents/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: xiaobai1017 (https://skillmd.com/u/xiaobai1017)
- Updated: 2026-09-22
- Page: https://skillmd.com/skills/xiaobai1017/get-file-contents

---


# get_file_contents

Get the contents of a file or directory from a GitHub repository

## Purpose

This skill provides access to the MCP tool `get_file_contents`. It allows you to get the contents of a file or directory from a github repository.

## Parameters

The tool accepts the following parameters:

### `owner`
**Required**
- **Type**: `string`
- **Description**: Repository owner (username or organization)

### `repo`
**Required**
- **Type**: `string`
- **Description**: Repository name

### `path`
**Required**
- **Type**: `string`
- **Description**: Path to the file or directory

### `branch`
*Optional*
- **Type**: `string`
- **Description**: Branch to get contents from


## Usage Instructions

To use this tool:

1. **Prepare the parameters** according to the schema above
2. **Invoke the MCP tool** `get_file_contents` with the prepared parameters
3. **Process the result** returned by the tool

## Example

```json
{
  "owner": "example_value",
  "repo": "example_value",
  "path": "example_value",
  "branch": "example_value"
}
```


## Notes

- This skill requires an active MCP connection to the server providing the `get_file_contents` tool
- Ensure the MCP server is properly configured and running before attempting to use this tool
- Review the parameter requirements carefully to avoid errors
