Pet/familiar sacrifices itself to be a component in the forging of a blade
I’m trying to find this book I read in elementary school. I cannot remember the main character’s name, at one point in the story he comes upon an orphanage where the people running it are sacrificing kids to a monster in a well. I believe he kills the monster or chases it out, then kills or removes the main person at the orphanage and charges one of the lesser people to do a better job. Later on in the story he has some kind of metallic animal that’s his companion and the main character is trying to have a sword forged for something, but the metals won’t combine. So this little metal companion of his sacrifices itself throws itself onto the forge, it gets melted down and the sword is made. Describes it as rigid and jagged? I also think the book ends with the return of some sorcerer that the had been waiting on? I don’t know that any of these are main points in the story or just things that happened in it but they’re the only things I can remember and if this rings bells for anybody, please throw a title to let me so I can find it and give it a look.