@@ -122,67 +122,53 @@ func HTTPHandler(eventChan <-chan lsprpc.SessionEvent, isDaemon bool) http.Handl
122
122
123
123
func newServer (session * cache.Session , server protocol.Server ) * mcp.Server {
124
124
s := mcp .NewServer ("golang" , "v0.1" , nil )
125
-
125
+ locationInput := mcp .Input (
126
+ mcp .Property (
127
+ "location" ,
128
+ mcp .Description ("location inside of a text file" ),
129
+ mcp .Property ("uri" , mcp .Description ("URI of the text document" )),
130
+ mcp .Property ("range" ,
131
+ mcp .Description ("range within text document" ),
132
+ mcp .Required (false ),
133
+ mcp .Property (
134
+ "start" ,
135
+ mcp .Description ("start position of range" ),
136
+ mcp .Property ("line" , mcp .Description ("line number (zero-based)" )),
137
+ mcp .Property ("character" , mcp .Description ("column number (zero-based, UTF-16 encoding)" )),
138
+ ),
139
+ mcp .Property (
140
+ "end" ,
141
+ mcp .Description ("end position of range" ),
142
+ mcp .Property ("line" , mcp .Description ("line number (zero-based)" )),
143
+ mcp .Property ("character" , mcp .Description ("column number (zero-based, UTF-16 encoding)" )),
144
+ ),
145
+ ),
146
+ ),
147
+ )
126
148
s .AddTools (
127
149
mcp .NewServerTool (
128
150
"context" ,
129
151
"Provide context for a region within a Go file" ,
130
152
func (ctx context.Context , _ * mcp.ServerSession , request * mcp.CallToolParamsFor [ContextParams ]) (* mcp.CallToolResultFor [struct {}], error ) {
131
153
return contextHandler (ctx , session , request )
132
154
},
133
- mcp .Input (
134
- mcp .Property (
135
- "location" ,
136
- mcp .Description ("location inside of a text file" ),
137
- mcp .Property ("uri" , mcp .Description ("URI of the text document" )),
138
- mcp .Property ("range" ,
139
- mcp .Description ("range within text document" ),
140
- mcp .Required (false ),
141
- mcp .Property (
142
- "start" ,
143
- mcp .Description ("start position of range" ),
144
- mcp .Property ("line" , mcp .Description ("line number (zero-based)" )),
145
- mcp .Property ("character" , mcp .Description ("column number (zero-based, UTF-16 encoding)" )),
146
- ),
147
- mcp .Property (
148
- "end" ,
149
- mcp .Description ("end position of range" ),
150
- mcp .Property ("line" , mcp .Description ("line number (zero-based)" )),
151
- mcp .Property ("character" , mcp .Description ("column number (zero-based, UTF-16 encoding)" )),
152
- ),
153
- ),
154
- ),
155
- ),
155
+ locationInput ,
156
156
),
157
157
mcp .NewServerTool (
158
158
"diagnostics" ,
159
159
"Provide diagnostics for a region within a Go file" ,
160
160
func (ctx context.Context , _ * mcp.ServerSession , request * mcp.CallToolParamsFor [DiagnosticsParams ]) (* mcp.CallToolResultFor [struct {}], error ) {
161
161
return diagnosticsHandler (ctx , session , server , request )
162
162
},
163
- mcp .Input (
164
- mcp .Property (
165
- "location" ,
166
- mcp .Description ("location inside of a text file" ),
167
- mcp .Property ("uri" , mcp .Description ("URI of the text document" )),
168
- mcp .Property ("range" ,
169
- mcp .Description ("range within text document" ),
170
- mcp .Required (false ),
171
- mcp .Property (
172
- "start" ,
173
- mcp .Description ("start position of range" ),
174
- mcp .Property ("line" , mcp .Description ("line number (zero-based)" )),
175
- mcp .Property ("character" , mcp .Description ("column number (zero-based, UTF-16 encoding)" )),
176
- ),
177
- mcp .Property (
178
- "end" ,
179
- mcp .Description ("end position of range" ),
180
- mcp .Property ("line" , mcp .Description ("line number (zero-based)" )),
181
- mcp .Property ("character" , mcp .Description ("column number (zero-based, UTF-16 encoding)" )),
182
- ),
183
- ),
184
- ),
185
- ),
163
+ locationInput ,
164
+ ),
165
+ mcp .NewServerTool (
166
+ "references" ,
167
+ "Provide the locations of references to a given object" ,
168
+ func (ctx context.Context , _ * mcp.ServerSession , request * mcp.CallToolParamsFor [FindReferencesParams ]) (* mcp.CallToolResultFor [struct {}], error ) {
169
+ return referenceHandler (ctx , session , request )
170
+ },
171
+ locationInput ,
186
172
),
187
173
)
188
174
return s
0 commit comments