fix: use default HEAD as ref#1335
Merged
olaservo merged 3 commits intomodelcontextprotocol:mainfrom Apr 19, 2025
Merged
Conversation
Contributor
Author
|
@tadasant Would you mind taking a look at this PR? Let me know if any changes are required |
olaservo
reviewed
Apr 19, 2025
src/gitlab/schemas.ts
Outdated
| }); | ||
|
|
||
| export const GetFileContentsSchema = ProjectParamsSchema.extend({ | ||
| project_id: z.string().describe("Project ID or URL-encoded path"), |
Member
There was a problem hiding this comment.
I think this is redundant since its already being inherited from the ProjectParamsSchema?
Contributor
Author
There was a problem hiding this comment.
Whoops, have removed it from schema
olaservo
approved these changes
Apr 19, 2025
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 fixes the
get_file_contentstool, as the ref is optional for the AI, but not set when a request is made to the gitlab API. It also sets the default ref toHEADfor thecreate_branchtool, this avoids making an unnecessary API request to retrieve it.Server Details
Motivation and Context
The
get_file_contentshas an optionalrefparameter for the AI tooling, but is not set properly in the API request when omitted by the AI.How Has This Been Tested?
Yeah have tested the MCP locally
Breaking Changes
No
Types of changes
Checklist
Additional context
See Repository Files API Gitlab Documentation
If you don’t know the branch name or want to use the default branch, you can use HEAD as the ref value. For example: