Replace read_file tool with deprecation notice in description, which is functionally just an alias for read_text_file
This commit is contained in:
parent
471ac89f55
commit
704275818f
1 changed files with 6 additions and 0 deletions
|
|
@ -498,6 +498,11 @@ async function readFileAsBase64Stream(filePath: string): Promise<string> {
|
|||
server.setRequestHandler(ListToolsRequestSchema, async () => {
|
||||
return {
|
||||
tools: [
|
||||
{
|
||||
name: "read_file",
|
||||
description: "Read the complete contents of a file as text. DEPRECATED: Use read_text_file instead.",
|
||||
inputSchema: zodToJsonSchema(ReadTextFileArgsSchema) as ToolInput,
|
||||
},
|
||||
{
|
||||
name: "read_text_file",
|
||||
description:
|
||||
|
|
@ -628,6 +633,7 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|||
const { name, arguments: args } = request.params;
|
||||
|
||||
switch (name) {
|
||||
case "read_file":
|
||||
case "read_text_file": {
|
||||
const parsed = ReadTextFileArgsSchema.safeParse(args);
|
||||
if (!parsed.success) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue